﻿/*!
 * jQuery JavaScript Library v1.8.2
 * http://jquery.com/
 *
 * Includes Sizzle.js
 * http://sizzlejs.com/
 *
 * Copyright 2012 jQuery Foundation and other contributors
 * Released under the MIT license
 * http://jquery.org/license
 *
 * Date: Thu Sep 20 2012 21:13:05 GMT-0400 (Eastern Daylight Time)
 */
function getRandomInt(e, t) {
    return Math.floor(Math.random() * (t - e + 1)) + e
}

function cutHex(e) {
    return e.charAt(0) == "#" ? e.substring(1, 7) : e
}

function getStyle(e, t) {
    var n = "";
    return document.defaultView && document.defaultView.getComputedStyle ? n = document.defaultView.getComputedStyle(e, "").getPropertyValue(t) : e.currentStyle && (t = t.replace(/\-(\w)/g, function (e, t) {
        return t.toUpperCase()
    }), n = e.currentStyle[t]), n
}

function onCreateElementNsReady(e) {
    document.createElementNS != undefined ? e() : setTimeout(function () {
        onCreateElementNsReady(e)
    }, 100)
}

function setServerName(e) {
    var t = $("#new-server-fqdn").val(),
        n = $("#new-server-name").val(),
        r = t;
    n && (r = n + " (" + t + ")"), e.wizard.setSubtitle(r), e.wizard.el.find(".create-server-name").text(r)
}

function validateIP(e) {
    e = e.replace(/\s/g, "");
    var t = /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/;
    if (t.test(e)) {
        var n = e.split(".");
        if (parseInt(parseFloat(n[0])) == 0) return !1;
        if (parseInt(parseFloat(n[3])) == 0) return !1;
        for (var r = 0; r < n.length; r++)
            if (parseInt(parseFloat(n[r])) > 255) return !1;
        return !0
    }
    return !1
}

function validateFQDN(e) {
    return /^[a-z0-9-_]+(\.[a-z0-9-_]+)*\.([a-z]{2,4})$/.test(e)
}

function fqdn_or_ip(e) {
    var t = e.val();
    return ret = {
        status: !0
    }, validateFQDN(t) || validateIP(t) || (ret.status = !1, ret.msg = "Invalid IP address or FQDN"), ret
}(function (e, t) {
    function _(e) {
        var t = M[e] = {};
        return v.each(e.split(y), function (e, n) {
            t[n] = !0
        }), t
    }

    function H(e, n, r) {
        if (r === t && e.nodeType === 1) {
            var i = "data-" + n.replace(P, "-$1").toLowerCase();
            r = e.getAttribute(i);
            if (typeof r == "string") {
                try {
                    r = r === "true" ? !0 : r === "false" ? !1 : r === "null" ? null : +r + "" === r ? +r : D.test(r) ? v.parseJSON(r) : r
                } catch (s) {}
                v.data(e, n, r)
            } else r = t
        }
        return r
    }

    function B(e) {
        var t;
        for (t in e) {
            if (t === "data" && v.isEmptyObject(e[t])) continue;
            if (t !== "toJSON") return !1
        }
        return !0
    }

    function et() {
        return !1
    }

    function tt() {
        return !0
    }

    function ut(e) {
        return !e || !e.parentNode || e.parentNode.nodeType === 11
    }

    function at(e, t) {
        do e = e[t]; while (e && e.nodeType !== 1);
        return e
    }

    function ft(e, t, n) {
        t = t || 0;
        if (v.isFunction(t)) return v.grep(e, function (e, r) {
            var i = !! t.call(e, r, e);
            return i === n
        });
        if (t.nodeType) return v.grep(e, function (e, r) {
            return e === t === n
        });
        if (typeof t == "string") {
            var r = v.grep(e, function (e) {
                return e.nodeType === 1
            });
            if (it.test(t)) return v.filter(t, r, !n);
            t = v.filter(t, r)
        }
        return v.grep(e, function (e, r) {
            return v.inArray(e, t) >= 0 === n
        })
    }

    function lt(e) {
        var t = ct.split("|"),
            n = e.createDocumentFragment();
        if (n.createElement)
            while (t.length) n.createElement(t.pop());
        return n
    }

    function Lt(e, t) {
        return e.getElementsByTagName(t)[0] || e.appendChild(e.ownerDocument.createElement(t))
    }

    function At(e, t) {
        if (t.nodeType !== 1 || !v.hasData(e)) return;
        var n, r, i, s = v._data(e),
            o = v._data(t, s),
            u = s.events;
        if (u) {
            delete o.handle, o.events = {};
            for (n in u)
                for (r = 0, i = u[n].length; r < i; r++) v.event.add(t, n, u[n][r])
        }
        o.data && (o.data = v.extend({}, o.data))
    }

    function Ot(e, t) {
        var n;
        if (t.nodeType !== 1) return;
        t.clearAttributes && t.clearAttributes(), t.mergeAttributes && t.mergeAttributes(e), n = t.nodeName.toLowerCase(), n === "object" ? (t.parentNode && (t.outerHTML = e.outerHTML), v.support.html5Clone && e.innerHTML && !v.trim(t.innerHTML) && (t.innerHTML = e.innerHTML)) : n === "input" && Et.test(e.type) ? (t.defaultChecked = t.checked = e.checked, t.value !== e.value && (t.value = e.value)) : n === "option" ? t.selected = e.defaultSelected : n === "input" || n === "textarea" ? t.defaultValue = e.defaultValue : n === "script" && t.text !== e.text && (t.text = e.text), t.removeAttribute(v.expando)
    }

    function Mt(e) {
        return typeof e.getElementsByTagName != "undefined" ? e.getElementsByTagName("*") : typeof e.querySelectorAll != "undefined" ? e.querySelectorAll("*") : []
    }

    function _t(e) {
        Et.test(e.type) && (e.defaultChecked = e.checked)
    }

    function Qt(e, t) {
        if (t in e) return t;
        var n = t.charAt(0).toUpperCase() + t.slice(1),
            r = t,
            i = Jt.length;
        while (i--) {
            t = Jt[i] + n;
            if (t in e) return t
        }
        return r
    }

    function Gt(e, t) {
        return e = t || e, v.css(e, "display") === "none" || !v.contains(e.ownerDocument, e)
    }

    function Yt(e, t) {
        var n, r, i = [],
            s = 0,
            o = e.length;
        for (; s < o; s++) {
            n = e[s];
            if (!n.style) continue;
            i[s] = v._data(n, "olddisplay"), t ? (!i[s] && n.style.display === "none" && (n.style.display = ""), n.style.display === "" && Gt(n) && (i[s] = v._data(n, "olddisplay", nn(n.nodeName)))) : (r = Dt(n, "display"), !i[s] && r !== "none" && v._data(n, "olddisplay", r))
        }
        for (s = 0; s < o; s++) {
            n = e[s];
            if (!n.style) continue;
            if (!t || n.style.display === "none" || n.style.display === "") n.style.display = t ? i[s] || "" : "none"
        }
        return e
    }

    function Zt(e, t, n) {
        var r = Rt.exec(t);
        return r ? Math.max(0, r[1] - (n || 0)) + (r[2] || "px") : t
    }

    function en(e, t, n, r) {
        var i = n === (r ? "border" : "content") ? 4 : t === "width" ? 1 : 0,
            s = 0;
        for (; i < 4; i += 2) n === "margin" && (s += v.css(e, n + $t[i], !0)), r ? (n === "content" && (s -= parseFloat(Dt(e, "padding" + $t[i])) || 0), n !== "margin" && (s -= parseFloat(Dt(e, "border" + $t[i] + "Width")) || 0)) : (s += parseFloat(Dt(e, "padding" + $t[i])) || 0, n !== "padding" && (s += parseFloat(Dt(e, "border" + $t[i] + "Width")) || 0));
        return s
    }

    function tn(e, t, n) {
        var r = t === "width" ? e.offsetWidth : e.offsetHeight,
            i = !0,
            s = v.support.boxSizing && v.css(e, "boxSizing") === "border-box";
        if (r <= 0 || r == null) {
            r = Dt(e, t);
            if (r < 0 || r == null) r = e.style[t];
            if (Ut.test(r)) return r;
            i = s && (v.support.boxSizingReliable || r === e.style[t]), r = parseFloat(r) || 0
        }
        return r + en(e, t, n || (s ? "border" : "content"), i) + "px"
    }

    function nn(e) {
        if (Wt[e]) return Wt[e];
        var t = v("<" + e + ">").appendTo(i.body),
            n = t.css("display");
        t.remove();
        if (n === "none" || n === "") {
            Pt = i.body.appendChild(Pt || v.extend(i.createElement("iframe"), {
                frameBorder: 0,
                width: 0,
                height: 0
            }));
            if (!Ht || !Pt.createElement) Ht = (Pt.contentWindow || Pt.contentDocument).document, Ht.write("<!doctype html><html><body>"), Ht.close();
            t = Ht.body.appendChild(Ht.createElement(e)), n = Dt(t, "display"), i.body.removeChild(Pt)
        }
        return Wt[e] = n, n
    }

    function fn(e, t, n, r) {
        var i;
        if (v.isArray(t)) v.each(t, function (t, i) {
            n || sn.test(e) ? r(e, i) : fn(e + "[" + (typeof i == "object" ? t : "") + "]", i, n, r)
        });
        else if (!n && v.type(t) === "object")
            for (i in t) fn(e + "[" + i + "]", t[i], n, r);
        else r(e, t)
    }

    function Cn(e) {
        return function (t, n) {
            typeof t != "string" && (n = t, t = "*");
            var r, i, s, o = t.toLowerCase().split(y),
                u = 0,
                a = o.length;
            if (v.isFunction(n))
                for (; u < a; u++) r = o[u], s = /^\+/.test(r), s && (r = r.substr(1) || "*"), i = e[r] = e[r] || [], i[s ? "unshift" : "push"](n)
        }
    }

    function kn(e, n, r, i, s, o) {
        s = s || n.dataTypes[0], o = o || {}, o[s] = !0;
        var u, a = e[s],
            f = 0,
            l = a ? a.length : 0,
            c = e === Sn;
        for (; f < l && (c || !u); f++) u = a[f](n, r, i), typeof u == "string" && (!c || o[u] ? u = t : (n.dataTypes.unshift(u), u = kn(e, n, r, i, u, o)));
        return (c || !u) && !o["*"] && (u = kn(e, n, r, i, "*", o)), u
    }

    function Ln(e, n) {
        var r, i, s = v.ajaxSettings.flatOptions || {};
        for (r in n) n[r] !== t && ((s[r] ? e : i || (i = {}))[r] = n[r]);
        i && v.extend(!0, e, i)
    }

    function An(e, n, r) {
        var i, s, o, u, a = e.contents,
            f = e.dataTypes,
            l = e.responseFields;
        for (s in l) s in r && (n[l[s]] = r[s]);
        while (f[0] === "*") f.shift(), i === t && (i = e.mimeType || n.getResponseHeader("content-type"));
        if (i)
            for (s in a)
                if (a[s] && a[s].test(i)) {
                    f.unshift(s);
                    break
                }
        if (f[0] in r) o = f[0];
        else {
            for (s in r) {
                if (!f[0] || e.converters[s + " " + f[0]]) {
                    o = s;
                    break
                }
                u || (u = s)
            }
            o = o || u
        } if (o) return o !== f[0] && f.unshift(o), r[o]
    }

    function On(e, t) {
        var n, r, i, s, o = e.dataTypes.slice(),
            u = o[0],
            a = {}, f = 0;
        e.dataFilter && (t = e.dataFilter(t, e.dataType));
        if (o[1])
            for (n in e.converters) a[n.toLowerCase()] = e.converters[n];
        for (; i = o[++f];)
            if (i !== "*") {
                if (u !== "*" && u !== i) {
                    n = a[u + " " + i] || a["* " + i];
                    if (!n)
                        for (r in a) {
                            s = r.split(" ");
                            if (s[1] === i) {
                                n = a[u + " " + s[0]] || a["* " + s[0]];
                                if (n) {
                                    n === !0 ? n = a[r] : a[r] !== !0 && (i = s[0], o.splice(f--, 0, i));
                                    break
                                }
                            }
                        }
                    if (n !== !0)
                        if (n && e["throws"]) t = n(t);
                        else try {
                            t = n(t)
                        } catch (l) {
                            return {
                                state: "parsererror",
                                error: n ? l : "No conversion from " + u + " to " + i
                            }
                        }
                }
                u = i
            }
        return {
            state: "success",
            data: t
        }
    }

    function Fn() {
        try {
            return new e.XMLHttpRequest
        } catch (t) {}
    }

    function In() {
        try {
            return new e.ActiveXObject("Microsoft.XMLHTTP")
        } catch (t) {}
    }

    function $n() {
        return setTimeout(function () {
            qn = t
        }, 0), qn = v.now()
    }

    function Jn(e, t) {
        v.each(t, function (t, n) {
            var r = (Vn[t] || []).concat(Vn["*"]),
                i = 0,
                s = r.length;
            for (; i < s; i++)
                if (r[i].call(e, t, n)) return
        })
    }

    function Kn(e, t, n) {
        var r, i = 0,
            s = 0,
            o = Xn.length,
            u = v.Deferred().always(function () {
                delete a.elem
            }),
            a = function () {
                var t = qn || $n(),
                    n = Math.max(0, f.startTime + f.duration - t),
                    r = 1 - (n / f.duration || 0),
                    i = 0,
                    s = f.tweens.length;
                for (; i < s; i++) f.tweens[i].run(r);
                return u.notifyWith(e, [f, r, n]), r < 1 && s ? n : (u.resolveWith(e, [f]), !1)
            }, f = u.promise({
                elem: e,
                props: v.extend({}, t),
                opts: v.extend(!0, {
                    specialEasing: {}
                }, n),
                originalProperties: t,
                originalOptions: n,
                startTime: qn || $n(),
                duration: n.duration,
                tweens: [],
                createTween: function (t, n, r) {
                    var i = v.Tween(e, f.opts, t, n, f.opts.specialEasing[t] || f.opts.easing);
                    return f.tweens.push(i), i
                },
                stop: function (t) {
                    var n = 0,
                        r = t ? f.tweens.length : 0;
                    for (; n < r; n++) f.tweens[n].run(1);
                    return t ? u.resolveWith(e, [f, t]) : u.rejectWith(e, [f, t]), this
                }
            }),
            l = f.props;
        Qn(l, f.opts.specialEasing);
        for (; i < o; i++) {
            r = Xn[i].call(f, e, l, f.opts);
            if (r) return r
        }
        return Jn(f, l), v.isFunction(f.opts.start) && f.opts.start.call(e, f), v.fx.timer(v.extend(a, {
            anim: f,
            queue: f.opts.queue,
            elem: e
        })), f.progress(f.opts.progress).done(f.opts.done, f.opts.complete).fail(f.opts.fail).always(f.opts.always)
    }

    function Qn(e, t) {
        var n, r, i, s, o;
        for (n in e) {
            r = v.camelCase(n), i = t[r], s = e[n], v.isArray(s) && (i = s[1], s = e[n] = s[0]), n !== r && (e[r] = s, delete e[n]), o = v.cssHooks[r];
            if (o && "expand" in o) {
                s = o.expand(s), delete e[r];
                for (n in s) n in e || (e[n] = s[n], t[n] = i)
            } else t[r] = i
        }
    }

    function Gn(e, t, n) {
        var r, i, s, o, u, a, f, l, c = this,
            h = e.style,
            p = {}, d = [],
            m = e.nodeType && Gt(e);
        n.queue || (f = v._queueHooks(e, "fx"), f.unqueued == null && (f.unqueued = 0, l = f.empty.fire, f.empty.fire = function () {
            f.unqueued || l()
        }), f.unqueued++, c.always(function () {
            c.always(function () {
                f.unqueued--, v.queue(e, "fx").length || f.empty.fire()
            })
        })), e.nodeType === 1 && ("height" in t || "width" in t) && (n.overflow = [h.overflow, h.overflowX, h.overflowY], v.css(e, "display") === "inline" && v.css(e, "float") === "none" && (!v.support.inlineBlockNeedsLayout || nn(e.nodeName) === "inline" ? h.display = "inline-block" : h.zoom = 1)), n.overflow && (h.overflow = "hidden", v.support.shrinkWrapBlocks || c.done(function () {
            h.overflow = n.overflow[0], h.overflowX = n.overflow[1], h.overflowY = n.overflow[2]
        }));
        for (r in t) {
            s = t[r];
            if (Un.exec(s)) {
                delete t[r];
                if (s === (m ? "hide" : "show")) continue;
                d.push(r)
            }
        }
        o = d.length;
        if (o) {
            u = v._data(e, "fxshow") || v._data(e, "fxshow", {}), m ? v(e).show() : c.done(function () {
                v(e).hide()
            }), c.done(function () {
                var t;
                v.removeData(e, "fxshow", !0);
                for (t in p) v.style(e, t, p[t])
            });
            for (r = 0; r < o; r++) i = d[r], a = c.createTween(i, m ? u[i] : 0), p[i] = u[i] || v.style(e, i), i in u || (u[i] = a.start, m && (a.end = a.start, a.start = i === "width" || i === "height" ? 1 : 0))
        }
    }

    function Yn(e, t, n, r, i) {
        return new Yn.prototype.init(e, t, n, r, i)
    }

    function Zn(e, t) {
        var n, r = {
                height: e
            }, i = 0;
        t = t ? 1 : 0;
        for (; i < 4; i += 2 - t) n = $t[i], r["margin" + n] = r["padding" + n] = e;
        return t && (r.opacity = r.width = e), r
    }

    function tr(e) {
        return v.isWindow(e) ? e : e.nodeType === 9 ? e.defaultView || e.parentWindow : !1
    }
    var n, r, i = e.document,
        s = e.location,
        o = e.navigator,
        u = e.jQuery,
        a = e.$,
        f = Array.prototype.push,
        l = Array.prototype.slice,
        c = Array.prototype.indexOf,
        h = Object.prototype.toString,
        p = Object.prototype.hasOwnProperty,
        d = String.prototype.trim,
        v = function (e, t) {
            return new v.fn.init(e, t, n)
        }, m = /[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source,
        g = /\S/,
        y = /\s+/,
        b = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
        w = /^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,
        E = /^<(\w+)\s*\/?>(?:<\/\1>|)$/,
        S = /^[\],:{}\s]*$/,
        x = /(?:^|:|,)(?:\s*\[)+/g,
        T = /\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,
        N = /"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/g,
        C = /^-ms-/,
        k = /-([\da-z])/gi,
        L = function (e, t) {
            return (t + "").toUpperCase()
        }, A = function () {
            i.addEventListener ? (i.removeEventListener("DOMContentLoaded", A, !1), v.ready()) : i.readyState === "complete" && (i.detachEvent("onreadystatechange", A), v.ready())
        }, O = {};
    v.fn = v.prototype = {
        constructor: v,
        init: function (e, n, r) {
            var s, o, u, a;
            if (!e) return this;
            if (e.nodeType) return this.context = this[0] = e, this.length = 1, this;
            if (typeof e == "string") {
                e.charAt(0) === "<" && e.charAt(e.length - 1) === ">" && e.length >= 3 ? s = [null, e, null] : s = w.exec(e);
                if (s && (s[1] || !n)) {
                    if (s[1]) return n = n instanceof v ? n[0] : n, a = n && n.nodeType ? n.ownerDocument || n : i, e = v.parseHTML(s[1], a, !0), E.test(s[1]) && v.isPlainObject(n) && this.attr.call(e, n, !0), v.merge(this, e);
                    o = i.getElementById(s[2]);
                    if (o && o.parentNode) {
                        if (o.id !== s[2]) return r.find(e);
                        this.length = 1, this[0] = o
                    }
                    return this.context = i, this.selector = e, this
                }
                return !n || n.jquery ? (n || r).find(e) : this.constructor(n).find(e)
            }
            return v.isFunction(e) ? r.ready(e) : (e.selector !== t && (this.selector = e.selector, this.context = e.context), v.makeArray(e, this))
        },
        selector: "",
        jquery: "1.8.2",
        length: 0,
        size: function () {
            return this.length
        },
        toArray: function () {
            return l.call(this)
        },
        get: function (e) {
            return e == null ? this.toArray() : e < 0 ? this[this.length + e] : this[e]
        },
        pushStack: function (e, t, n) {
            var r = v.merge(this.constructor(), e);
            return r.prevObject = this, r.context = this.context, t === "find" ? r.selector = this.selector + (this.selector ? " " : "") + n : t && (r.selector = this.selector + "." + t + "(" + n + ")"), r
        },
        each: function (e, t) {
            return v.each(this, e, t)
        },
        ready: function (e) {
            return v.ready.promise().done(e), this
        },
        eq: function (e) {
            return e = +e, e === -1 ? this.slice(e) : this.slice(e, e + 1)
        },
        first: function () {
            return this.eq(0)
        },
        last: function () {
            return this.eq(-1)
        },
        slice: function () {
            return this.pushStack(l.apply(this, arguments), "slice", l.call(arguments).join(","))
        },
        map: function (e) {
            return this.pushStack(v.map(this, function (t, n) {
                return e.call(t, n, t)
            }))
        },
        end: function () {
            return this.prevObject || this.constructor(null)
        },
        push: f,
        sort: [].sort,
        splice: [].splice
    }, v.fn.init.prototype = v.fn, v.extend = v.fn.extend = function () {
        var e, n, r, i, s, o, u = arguments[0] || {}, a = 1,
            f = arguments.length,
            l = !1;
        typeof u == "boolean" && (l = u, u = arguments[1] || {}, a = 2), typeof u != "object" && !v.isFunction(u) && (u = {}), f === a && (u = this, --a);
        for (; a < f; a++)
            if ((e = arguments[a]) != null)
                for (n in e) {
                    r = u[n], i = e[n];
                    if (u === i) continue;
                    l && i && (v.isPlainObject(i) || (s = v.isArray(i))) ? (s ? (s = !1, o = r && v.isArray(r) ? r : []) : o = r && v.isPlainObject(r) ? r : {}, u[n] = v.extend(l, o, i)) : i !== t && (u[n] = i)
                }
            return u
    }, v.extend({
        noConflict: function (t) {
            return e.$ === v && (e.$ = a), t && e.jQuery === v && (e.jQuery = u), v
        },
        isReady: !1,
        readyWait: 1,
        holdReady: function (e) {
            e ? v.readyWait++ : v.ready(!0)
        },
        ready: function (e) {
            if (e === !0 ? --v.readyWait : v.isReady) return;
            if (!i.body) return setTimeout(v.ready, 1);
            v.isReady = !0;
            if (e !== !0 && --v.readyWait > 0) return;
            r.resolveWith(i, [v]), v.fn.trigger && v(i).trigger("ready").off("ready")
        },
        isFunction: function (e) {
            return v.type(e) === "function"
        },
        isArray: Array.isArray || function (e) {
            return v.type(e) === "array"
        },
        isWindow: function (e) {
            return e != null && e == e.window
        },
        isNumeric: function (e) {
            return !isNaN(parseFloat(e)) && isFinite(e)
        },
        type: function (e) {
            return e == null ? String(e) : O[h.call(e)] || "object"
        },
        isPlainObject: function (e) {
            if (!e || v.type(e) !== "object" || e.nodeType || v.isWindow(e)) return !1;
            try {
                if (e.constructor && !p.call(e, "constructor") && !p.call(e.constructor.prototype, "isPrototypeOf")) return !1
            } catch (n) {
                return !1
            }
            var r;
            for (r in e);
            return r === t || p.call(e, r)
        },
        isEmptyObject: function (e) {
            var t;
            for (t in e) return !1;
            return !0
        },
        error: function (e) {
            throw new Error(e)
        },
        parseHTML: function (e, t, n) {
            var r;
            return !e || typeof e != "string" ? null : (typeof t == "boolean" && (n = t, t = 0), t = t || i, (r = E.exec(e)) ? [t.createElement(r[1])] : (r = v.buildFragment([e], t, n ? null : []), v.merge([], (r.cacheable ? v.clone(r.fragment) : r.fragment).childNodes)))
        },
        parseJSON: function (t) {
            if (!t || typeof t != "string") return null;
            t = v.trim(t);
            if (e.JSON && e.JSON.parse) return e.JSON.parse(t);
            if (S.test(t.replace(T, "@").replace(N, "]").replace(x, ""))) return (new Function("return " + t))();
            v.error("Invalid JSON: " + t)
        },
        parseXML: function (n) {
            var r, i;
            if (!n || typeof n != "string") return null;
            try {
                e.DOMParser ? (i = new DOMParser, r = i.parseFromString(n, "text/xml")) : (r = new ActiveXObject("Microsoft.XMLDOM"), r.async = "false", r.loadXML(n))
            } catch (s) {
                r = t
            }
            return (!r || !r.documentElement || r.getElementsByTagName("parsererror").length) && v.error("Invalid XML: " + n), r
        },
        noop: function () {},
        globalEval: function (t) {
            t && g.test(t) && (e.execScript || function (t) {
                e.eval.call(e, t)
            })(t)
        },
        camelCase: function (e) {
            return e.replace(C, "ms-").replace(k, L)
        },
        nodeName: function (e, t) {
            return e.nodeName && e.nodeName.toLowerCase() === t.toLowerCase()
        },
        each: function (e, n, r) {
            var i, s = 0,
                o = e.length,
                u = o === t || v.isFunction(e);
            if (r) {
                if (u) {
                    for (i in e)
                        if (n.apply(e[i], r) === !1) break
                } else
                    for (; s < o;)
                        if (n.apply(e[s++], r) === !1) break
            } else if (u) {
                for (i in e)
                    if (n.call(e[i], i, e[i]) === !1) break
            } else
                for (; s < o;)
                    if (n.call(e[s], s, e[s++]) === !1) break; return e
        },
        trim: d && !d.call("﻿ ") ? function (e) {
            return e == null ? "" : d.call(e)
        } : function (e) {
            return e == null ? "" : (e + "").replace(b, "")
        },
        makeArray: function (e, t) {
            var n, r = t || [];
            return e != null && (n = v.type(e), e.length == null || n === "string" || n === "function" || n === "regexp" || v.isWindow(e) ? f.call(r, e) : v.merge(r, e)), r
        },
        inArray: function (e, t, n) {
            var r;
            if (t) {
                if (c) return c.call(t, e, n);
                r = t.length, n = n ? n < 0 ? Math.max(0, r + n) : n : 0;
                for (; n < r; n++)
                    if (n in t && t[n] === e) return n
            }
            return -1
        },
        merge: function (e, n) {
            var r = n.length,
                i = e.length,
                s = 0;
            if (typeof r == "number")
                for (; s < r; s++) e[i++] = n[s];
            else
                while (n[s] !== t) e[i++] = n[s++];
            return e.length = i, e
        },
        grep: function (e, t, n) {
            var r, i = [],
                s = 0,
                o = e.length;
            n = !! n;
            for (; s < o; s++) r = !! t(e[s], s), n !== r && i.push(e[s]);
            return i
        },
        map: function (e, n, r) {
            var i, s, o = [],
                u = 0,
                a = e.length,
                f = e instanceof v || a !== t && typeof a == "number" && (a > 0 && e[0] && e[a - 1] || a === 0 || v.isArray(e));
            if (f)
                for (; u < a; u++) i = n(e[u], u, r), i != null && (o[o.length] = i);
            else
                for (s in e) i = n(e[s], s, r), i != null && (o[o.length] = i);
            return o.concat.apply([], o)
        },
        guid: 1,
        proxy: function (e, n) {
            var r, i, s;
            return typeof n == "string" && (r = e[n], n = e, e = r), v.isFunction(e) ? (i = l.call(arguments, 2), s = function () {
                return e.apply(n, i.concat(l.call(arguments)))
            }, s.guid = e.guid = e.guid || v.guid++, s) : t
        },
        access: function (e, n, r, i, s, o, u) {
            var a, f = r == null,
                l = 0,
                c = e.length;
            if (r && typeof r == "object") {
                for (l in r) v.access(e, n, l, r[l], 1, o, i);
                s = 1
            } else if (i !== t) {
                a = u === t && v.isFunction(i), f && (a ? (a = n, n = function (e, t, n) {
                    return a.call(v(e), n)
                }) : (n.call(e, i), n = null));
                if (n)
                    for (; l < c; l++) n(e[l], r, a ? i.call(e[l], l, n(e[l], r)) : i, u);
                s = 1
            }
            return s ? e : f ? n.call(e) : c ? n(e[0], r) : o
        },
        now: function () {
            return (new Date).getTime()
        }
    }), v.ready.promise = function (t) {
        if (!r) {
            r = v.Deferred();
            if (i.readyState === "complete") setTimeout(v.ready, 1);
            else if (i.addEventListener) i.addEventListener("DOMContentLoaded", A, !1), e.addEventListener("load", v.ready, !1);
            else {
                i.attachEvent("onreadystatechange", A), e.attachEvent("onload", v.ready);
                var n = !1;
                try {
                    n = e.frameElement == null && i.documentElement
                } catch (s) {}
                n && n.doScroll && function o() {
                    if (!v.isReady) {
                        try {
                            n.doScroll("left")
                        } catch (e) {
                            return setTimeout(o, 50)
                        }
                        v.ready()
                    }
                }()
            }
        }
        return r.promise(t)
    }, v.each("Boolean Number String Function Array Date RegExp Object".split(" "), function (e, t) {
        O["[object " + t + "]"] = t.toLowerCase()
    }), n = v(i);
    var M = {};
    v.Callbacks = function (e) {
        e = typeof e == "string" ? M[e] || _(e) : v.extend({}, e);
        var n, r, i, s, o, u, a = [],
            f = !e.once && [],
            l = function (t) {
                n = e.memory && t, r = !0, u = s || 0, s = 0, o = a.length, i = !0;
                for (; a && u < o; u++)
                    if (a[u].apply(t[0], t[1]) === !1 && e.stopOnFalse) {
                        n = !1;
                        break
                    }
                i = !1, a && (f ? f.length && l(f.shift()) : n ? a = [] : c.disable())
            }, c = {
                add: function () {
                    if (a) {
                        var t = a.length;
                        (function r(t) {
                            v.each(t, function (t, n) {
                                var i = v.type(n);
                                i === "function" && (!e.unique || !c.has(n)) ? a.push(n) : n && n.length && i !== "string" && r(n)
                            })
                        })(arguments), i ? o = a.length : n && (s = t, l(n))
                    }
                    return this
                },
                remove: function () {
                    return a && v.each(arguments, function (e, t) {
                        var n;
                        while ((n = v.inArray(t, a, n)) > -1) a.splice(n, 1), i && (n <= o && o--, n <= u && u--)
                    }), this
                },
                has: function (e) {
                    return v.inArray(e, a) > -1
                },
                empty: function () {
                    return a = [], this
                },
                disable: function () {
                    return a = f = n = t, this
                },
                disabled: function () {
                    return !a
                },
                lock: function () {
                    return f = t, n || c.disable(), this
                },
                locked: function () {
                    return !f
                },
                fireWith: function (e, t) {
                    return t = t || [], t = [e, t.slice ? t.slice() : t], a && (!r || f) && (i ? f.push(t) : l(t)), this
                },
                fire: function () {
                    return c.fireWith(this, arguments), this
                },
                fired: function () {
                    return !!r
                }
            };
        return c
    }, v.extend({
        Deferred: function (e) {
            var t = [
                ["resolve", "done", v.Callbacks("once memory"), "resolved"],
                ["reject", "fail", v.Callbacks("once memory"), "rejected"],
                ["notify", "progress", v.Callbacks("memory")]
            ],
                n = "pending",
                r = {
                    state: function () {
                        return n
                    },
                    always: function () {
                        return i.done(arguments).fail(arguments), this
                    },
                    then: function () {
                        var e = arguments;
                        return v.Deferred(function (n) {
                            v.each(t, function (t, r) {
                                var s = r[0],
                                    o = e[t];
                                i[r[1]](v.isFunction(o) ? function () {
                                    var e = o.apply(this, arguments);
                                    e && v.isFunction(e.promise) ? e.promise().done(n.resolve).fail(n.reject).progress(n.notify) : n[s + "With"](this === i ? n : this, [e])
                                } : n[s])
                            }), e = null
                        }).promise()
                    },
                    promise: function (e) {
                        return e != null ? v.extend(e, r) : r
                    }
                }, i = {};
            return r.pipe = r.then, v.each(t, function (e, s) {
                var o = s[2],
                    u = s[3];
                r[s[1]] = o.add, u && o.add(function () {
                    n = u
                }, t[e ^ 1][2].disable, t[2][2].lock), i[s[0]] = o.fire, i[s[0] + "With"] = o.fireWith
            }), r.promise(i), e && e.call(i, i), i
        },
        when: function (e) {
            var t = 0,
                n = l.call(arguments),
                r = n.length,
                i = r !== 1 || e && v.isFunction(e.promise) ? r : 0,
                s = i === 1 ? e : v.Deferred(),
                o = function (e, t, n) {
                    return function (r) {
                        t[e] = this, n[e] = arguments.length > 1 ? l.call(arguments) : r, n === u ? s.notifyWith(t, n) : --i || s.resolveWith(t, n)
                    }
                }, u, a, f;
            if (r > 1) {
                u = new Array(r), a = new Array(r), f = new Array(r);
                for (; t < r; t++) n[t] && v.isFunction(n[t].promise) ? n[t].promise().done(o(t, f, n)).fail(s.reject).progress(o(t, a, u)) : --i
            }
            return i || s.resolveWith(f, n), s.promise()
        }
    }), v.support = function () {
        var t, n, r, s, o, u, a, f, l, c, h, p = i.createElement("div");
        p.setAttribute("className", "t"), p.innerHTML = "  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>", n = p.getElementsByTagName("*"), r = p.getElementsByTagName("a")[0], r.style.cssText = "top:1px;float:left;opacity:.5";
        if (!n || !n.length) return {};
        s = i.createElement("select"), o = s.appendChild(i.createElement("option")), u = p.getElementsByTagName("input")[0], t = {
            leadingWhitespace: p.firstChild.nodeType === 3,
            tbody: !p.getElementsByTagName("tbody").length,
            htmlSerialize: !! p.getElementsByTagName("link").length,
            style: /top/.test(r.getAttribute("style")),
            hrefNormalized: r.getAttribute("href") === "/a",
            opacity: /^0.5/.test(r.style.opacity),
            cssFloat: !! r.style.cssFloat,
            checkOn: u.value === "on",
            optSelected: o.selected,
            getSetAttribute: p.className !== "t",
            enctype: !! i.createElement("form").enctype,
            html5Clone: i.createElement("nav").cloneNode(!0).outerHTML !== "<:nav></:nav>",
            boxModel: i.compatMode === "CSS1Compat",
            submitBubbles: !0,
            changeBubbles: !0,
            focusinBubbles: !1,
            deleteExpando: !0,
            noCloneEvent: !0,
            inlineBlockNeedsLayout: !1,
            shrinkWrapBlocks: !1,
            reliableMarginRight: !0,
            boxSizingReliable: !0,
            pixelPosition: !1
        }, u.checked = !0, t.noCloneChecked = u.cloneNode(!0).checked, s.disabled = !0, t.optDisabled = !o.disabled;
        try {
            delete p.test
        } catch (d) {
            t.deleteExpando = !1
        }!p.addEventListener && p.attachEvent && p.fireEvent && (p.attachEvent("onclick", h = function () {
            t.noCloneEvent = !1
        }), p.cloneNode(!0).fireEvent("onclick"), p.detachEvent("onclick", h)), u = i.createElement("input"), u.value = "t", u.setAttribute("type", "radio"), t.radioValue = u.value === "t", u.setAttribute("checked", "checked"), u.setAttribute("name", "t"), p.appendChild(u), a = i.createDocumentFragment(), a.appendChild(p.lastChild), t.checkClone = a.cloneNode(!0).cloneNode(!0).lastChild.checked, t.appendChecked = u.checked, a.removeChild(u), a.appendChild(p);
        if (p.attachEvent)
            for (l in {
                submit: !0,
                change: !0,
                focusin: !0
            }) f = "on" + l, c = f in p, c || (p.setAttribute(f, "return;"), c = typeof p[f] == "function"), t[l + "Bubbles"] = c;
        return v(function () {
            var n, r, s, o, u = "padding:0;margin:0;border:0;display:block;overflow:hidden;",
                a = i.getElementsByTagName("body")[0];
            if (!a) return;
            n = i.createElement("div"), n.style.cssText = "visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px", a.insertBefore(n, a.firstChild), r = i.createElement("div"), n.appendChild(r), r.innerHTML = "<table><tr><td></td><td>t</td></tr></table>", s = r.getElementsByTagName("td"), s[0].style.cssText = "padding:0;margin:0;border:0;display:none", c = s[0].offsetHeight === 0, s[0].style.display = "", s[1].style.display = "none", t.reliableHiddenOffsets = c && s[0].offsetHeight === 0, r.innerHTML = "", r.style.cssText = "box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;", t.boxSizing = r.offsetWidth === 4, t.doesNotIncludeMarginInBodyOffset = a.offsetTop !== 1, e.getComputedStyle && (t.pixelPosition = (e.getComputedStyle(r, null) || {}).top !== "1%", t.boxSizingReliable = (e.getComputedStyle(r, null) || {
                width: "4px"
            }).width === "4px", o = i.createElement("div"), o.style.cssText = r.style.cssText = u, o.style.marginRight = o.style.width = "0", r.style.width = "1px", r.appendChild(o), t.reliableMarginRight = !parseFloat((e.getComputedStyle(o, null) || {}).marginRight)), typeof r.style.zoom != "undefined" && (r.innerHTML = "", r.style.cssText = u + "width:1px;padding:1px;display:inline;zoom:1", t.inlineBlockNeedsLayout = r.offsetWidth === 3, r.style.display = "block", r.style.overflow = "visible", r.innerHTML = "<div></div>", r.firstChild.style.width = "5px", t.shrinkWrapBlocks = r.offsetWidth !== 3, n.style.zoom = 1), a.removeChild(n), n = r = s = o = null
        }), a.removeChild(p), n = r = s = o = u = a = p = null, t
    }();
    var D = /(?:\{[\s\S]*\}|\[[\s\S]*\])$/,
        P = /([A-Z])/g;
    v.extend({
        cache: {},
        deletedIds: [],
        uuid: 0,
        expando: "jQuery" + (v.fn.jquery + Math.random()).replace(/\D/g, ""),
        noData: {
            embed: !0,
            object: "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",
            applet: !0
        },
        hasData: function (e) {
            return e = e.nodeType ? v.cache[e[v.expando]] : e[v.expando], !! e && !B(e)
        },
        data: function (e, n, r, i) {
            if (!v.acceptData(e)) return;
            var s, o, u = v.expando,
                a = typeof n == "string",
                f = e.nodeType,
                l = f ? v.cache : e,
                c = f ? e[u] : e[u] && u;
            if ((!c || !l[c] || !i && !l[c].data) && a && r === t) return;
            c || (f ? e[u] = c = v.deletedIds.pop() || v.guid++ : c = u), l[c] || (l[c] = {}, f || (l[c].toJSON = v.noop));
            if (typeof n == "object" || typeof n == "function") i ? l[c] = v.extend(l[c], n) : l[c].data = v.extend(l[c].data, n);
            return s = l[c], i || (s.data || (s.data = {}), s = s.data), r !== t && (s[v.camelCase(n)] = r), a ? (o = s[n], o == null && (o = s[v.camelCase(n)])) : o = s, o
        },
        removeData: function (e, t, n) {
            if (!v.acceptData(e)) return;
            var r, i, s, o = e.nodeType,
                u = o ? v.cache : e,
                a = o ? e[v.expando] : v.expando;
            if (!u[a]) return;
            if (t) {
                r = n ? u[a] : u[a].data;
                if (r) {
                    v.isArray(t) || (t in r ? t = [t] : (t = v.camelCase(t), t in r ? t = [t] : t = t.split(" ")));
                    for (i = 0, s = t.length; i < s; i++) delete r[t[i]];
                    if (!(n ? B : v.isEmptyObject)(r)) return
                }
            }
            if (!n) {
                delete u[a].data;
                if (!B(u[a])) return
            }
            o ? v.cleanData([e], !0) : v.support.deleteExpando || u != u.window ? delete u[a] : u[a] = null
        },
        _data: function (e, t, n) {
            return v.data(e, t, n, !0)
        },
        acceptData: function (e) {
            var t = e.nodeName && v.noData[e.nodeName.toLowerCase()];
            return !t || t !== !0 && e.getAttribute("classid") === t
        }
    }), v.fn.extend({
        data: function (e, n) {
            var r, i, s, o, u, a = this[0],
                f = 0,
                l = null;
            if (e === t) {
                if (this.length) {
                    l = v.data(a);
                    if (a.nodeType === 1 && !v._data(a, "parsedAttrs")) {
                        s = a.attributes;
                        for (u = s.length; f < u; f++) o = s[f].name, o.indexOf("data-") || (o = v.camelCase(o.substring(5)), H(a, o, l[o]));
                        v._data(a, "parsedAttrs", !0)
                    }
                }
                return l
            }
            return typeof e == "object" ? this.each(function () {
                v.data(this, e)
            }) : (r = e.split(".", 2), r[1] = r[1] ? "." + r[1] : "", i = r[1] + "!", v.access(this, function (n) {
                if (n === t) return l = this.triggerHandler("getData" + i, [r[0]]), l === t && a && (l = v.data(a, e), l = H(a, e, l)), l === t && r[1] ? this.data(r[0]) : l;
                r[1] = n, this.each(function () {
                    var t = v(this);
                    t.triggerHandler("setData" + i, r), v.data(this, e, n), t.triggerHandler("changeData" + i, r)
                })
            }, null, n, arguments.length > 1, null, !1))
        },
        removeData: function (e) {
            return this.each(function () {
                v.removeData(this, e)
            })
        }
    }), v.extend({
        queue: function (e, t, n) {
            var r;
            if (e) return t = (t || "fx") + "queue", r = v._data(e, t), n && (!r || v.isArray(n) ? r = v._data(e, t, v.makeArray(n)) : r.push(n)), r || []
        },
        dequeue: function (e, t) {
            t = t || "fx";
            var n = v.queue(e, t),
                r = n.length,
                i = n.shift(),
                s = v._queueHooks(e, t),
                o = function () {
                    v.dequeue(e, t)
                };
            i === "inprogress" && (i = n.shift(), r--), i && (t === "fx" && n.unshift("inprogress"), delete s.stop, i.call(e, o, s)), !r && s && s.empty.fire()
        },
        _queueHooks: function (e, t) {
            var n = t + "queueHooks";
            return v._data(e, n) || v._data(e, n, {
                empty: v.Callbacks("once memory").add(function () {
                    v.removeData(e, t + "queue", !0), v.removeData(e, n, !0)
                })
            })
        }
    }), v.fn.extend({
        queue: function (e, n) {
            var r = 2;
            return typeof e != "string" && (n = e, e = "fx", r--), arguments.length < r ? v.queue(this[0], e) : n === t ? this : this.each(function () {
                var t = v.queue(this, e, n);
                v._queueHooks(this, e), e === "fx" && t[0] !== "inprogress" && v.dequeue(this, e)
            })
        },
        dequeue: function (e) {
            return this.each(function () {
                v.dequeue(this, e)
            })
        },
        delay: function (e, t) {
            return e = v.fx ? v.fx.speeds[e] || e : e, t = t || "fx", this.queue(t, function (t, n) {
                var r = setTimeout(t, e);
                n.stop = function () {
                    clearTimeout(r)
                }
            })
        },
        clearQueue: function (e) {
            return this.queue(e || "fx", [])
        },
        promise: function (e, n) {
            var r, i = 1,
                s = v.Deferred(),
                o = this,
                u = this.length,
                a = function () {
                    --i || s.resolveWith(o, [o])
                };
            typeof e != "string" && (n = e, e = t), e = e || "fx";
            while (u--) r = v._data(o[u], e + "queueHooks"), r && r.empty && (i++, r.empty.add(a));
            return a(), s.promise(n)
        }
    });
    var j, F, I, q = /[\t\r\n]/g,
        R = /\r/g,
        U = /^(?:button|input)$/i,
        z = /^(?:button|input|object|select|textarea)$/i,
        W = /^a(?:rea|)$/i,
        X = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,
        V = v.support.getSetAttribute;
    v.fn.extend({
        attr: function (e, t) {
            return v.access(this, v.attr, e, t, arguments.length > 1)
        },
        removeAttr: function (e) {
            return this.each(function () {
                v.removeAttr(this, e)
            })
        },
        prop: function (e, t) {
            return v.access(this, v.prop, e, t, arguments.length > 1)
        },
        removeProp: function (e) {
            return e = v.propFix[e] || e, this.each(function () {
                try {
                    this[e] = t, delete this[e]
                } catch (n) {}
            })
        },
        addClass: function (e) {
            var t, n, r, i, s, o, u;
            if (v.isFunction(e)) return this.each(function (t) {
                v(this).addClass(e.call(this, t, this.className))
            });
            if (e && typeof e == "string") {
                t = e.split(y);
                for (n = 0, r = this.length; n < r; n++) {
                    i = this[n];
                    if (i.nodeType === 1)
                        if (!i.className && t.length === 1) i.className = e;
                        else {
                            s = " " + i.className + " ";
                            for (o = 0, u = t.length; o < u; o++) s.indexOf(" " + t[o] + " ") < 0 && (s += t[o] + " ");
                            i.className = v.trim(s)
                        }
                }
            }
            return this
        },
        removeClass: function (e) {
            var n, r, i, s, o, u, a;
            if (v.isFunction(e)) return this.each(function (t) {
                v(this).removeClass(e.call(this, t, this.className))
            });
            if (e && typeof e == "string" || e === t) {
                n = (e || "").split(y);
                for (u = 0, a = this.length; u < a; u++) {
                    i = this[u];
                    if (i.nodeType === 1 && i.className) {
                        r = (" " + i.className + " ").replace(q, " ");
                        for (s = 0, o = n.length; s < o; s++)
                            while (r.indexOf(" " + n[s] + " ") >= 0) r = r.replace(" " + n[s] + " ", " ");
                        i.className = e ? v.trim(r) : ""
                    }
                }
            }
            return this
        },
        toggleClass: function (e, t) {
            var n = typeof e,
                r = typeof t == "boolean";
            return v.isFunction(e) ? this.each(function (n) {
                v(this).toggleClass(e.call(this, n, this.className, t), t)
            }) : this.each(function () {
                if (n === "string") {
                    var i, s = 0,
                        o = v(this),
                        u = t,
                        a = e.split(y);
                    while (i = a[s++]) u = r ? u : !o.hasClass(i), o[u ? "addClass" : "removeClass"](i)
                } else if (n === "undefined" || n === "boolean") this.className && v._data(this, "__className__", this.className), this.className = this.className || e === !1 ? "" : v._data(this, "__className__") || ""
            })
        },
        hasClass: function (e) {
            var t = " " + e + " ",
                n = 0,
                r = this.length;
            for (; n < r; n++)
                if (this[n].nodeType === 1 && (" " + this[n].className + " ").replace(q, " ").indexOf(t) >= 0) return !0;
            return !1
        },
        val: function (e) {
            var n, r, i, s = this[0];
            if (!arguments.length) {
                if (s) return n = v.valHooks[s.type] || v.valHooks[s.nodeName.toLowerCase()], n && "get" in n && (r = n.get(s, "value")) !== t ? r : (r = s.value, typeof r == "string" ? r.replace(R, "") : r == null ? "" : r);
                return
            }
            return i = v.isFunction(e), this.each(function (r) {
                var s, o = v(this);
                if (this.nodeType !== 1) return;
                i ? s = e.call(this, r, o.val()) : s = e, s == null ? s = "" : typeof s == "number" ? s += "" : v.isArray(s) && (s = v.map(s, function (e) {
                    return e == null ? "" : e + ""
                })), n = v.valHooks[this.type] || v.valHooks[this.nodeName.toLowerCase()];
                if (!n || !("set" in n) || n.set(this, s, "value") === t) this.value = s
            })
        }
    }), v.extend({
        valHooks: {
            option: {
                get: function (e) {
                    var t = e.attributes.value;
                    return !t || t.specified ? e.value : e.text
                }
            },
            select: {
                get: function (e) {
                    var t, n, r, i, s = e.selectedIndex,
                        o = [],
                        u = e.options,
                        a = e.type === "select-one";
                    if (s < 0) return null;
                    n = a ? s : 0, r = a ? s + 1 : u.length;
                    for (; n < r; n++) {
                        i = u[n];
                        if (i.selected && (v.support.optDisabled ? !i.disabled : i.getAttribute("disabled") === null) && (!i.parentNode.disabled || !v.nodeName(i.parentNode, "optgroup"))) {
                            t = v(i).val();
                            if (a) return t;
                            o.push(t)
                        }
                    }
                    return a && !o.length && u.length ? v(u[s]).val() : o
                },
                set: function (e, t) {
                    var n = v.makeArray(t);
                    return v(e).find("option").each(function () {
                        this.selected = v.inArray(v(this).val(), n) >= 0
                    }), n.length || (e.selectedIndex = -1), n
                }
            }
        },
        attrFn: {},
        attr: function (e, n, r, i) {
            var s, o, u, a = e.nodeType;
            if (!e || a === 3 || a === 8 || a === 2) return;
            if (i && v.isFunction(v.fn[n])) return v(e)[n](r);
            if (typeof e.getAttribute == "undefined") return v.prop(e, n, r);
            u = a !== 1 || !v.isXMLDoc(e), u && (n = n.toLowerCase(), o = v.attrHooks[n] || (X.test(n) ? F : j));
            if (r !== t) {
                if (r === null) {
                    v.removeAttr(e, n);
                    return
                }
                return o && "set" in o && u && (s = o.set(e, r, n)) !== t ? s : (e.setAttribute(n, r + ""), r)
            }
            return o && "get" in o && u && (s = o.get(e, n)) !== null ? s : (s = e.getAttribute(n), s === null ? t : s)
        },
        removeAttr: function (e, t) {
            var n, r, i, s, o = 0;
            if (t && e.nodeType === 1) {
                r = t.split(y);
                for (; o < r.length; o++) i = r[o], i && (n = v.propFix[i] || i, s = X.test(i), s || v.attr(e, i, ""), e.removeAttribute(V ? i : n), s && n in e && (e[n] = !1))
            }
        },
        attrHooks: {
            type: {
                set: function (e, t) {
                    if (U.test(e.nodeName) && e.parentNode) v.error("type property can't be changed");
                    else if (!v.support.radioValue && t === "radio" && v.nodeName(e, "input")) {
                        var n = e.value;
                        return e.setAttribute("type", t), n && (e.value = n), t
                    }
                }
            },
            value: {
                get: function (e, t) {
                    return j && v.nodeName(e, "button") ? j.get(e, t) : t in e ? e.value : null
                },
                set: function (e, t, n) {
                    if (j && v.nodeName(e, "button")) return j.set(e, t, n);
                    e.value = t
                }
            }
        },
        propFix: {
            tabindex: "tabIndex",
            readonly: "readOnly",
            "for": "htmlFor",
            "class": "className",
            maxlength: "maxLength",
            cellspacing: "cellSpacing",
            cellpadding: "cellPadding",
            rowspan: "rowSpan",
            colspan: "colSpan",
            usemap: "useMap",
            frameborder: "frameBorder",
            contenteditable: "contentEditable"
        },
        prop: function (e, n, r) {
            var i, s, o, u = e.
                nodeType;
            if (!e || u === 3 || u === 8 || u === 2) return;
            return o = u !== 1 || !v.isXMLDoc(e), o && (n = v.propFix[n] || n, s = v.propHooks[n]), r !== t ? s && "set" in s && (i = s.set(e, r, n)) !== t ? i : e[n] = r : s && "get" in s && (i = s.get(e, n)) !== null ? i : e[n]
        },
        propHooks: {
            tabIndex: {
                get: function (e) {
                    var n = e.getAttributeNode("tabindex");
                    return n && n.specified ? parseInt(n.value, 10) : z.test(e.nodeName) || W.test(e.nodeName) && e.href ? 0 : t
                }
            }
        }
    }), F = {
        get: function (e, n) {
            var r, i = v.prop(e, n);
            return i === !0 || typeof i != "boolean" && (r = e.getAttributeNode(n)) && r.nodeValue !== !1 ? n.toLowerCase() : t
        },
        set: function (e, t, n) {
            var r;
            return t === !1 ? v.removeAttr(e, n) : (r = v.propFix[n] || n, r in e && (e[r] = !0), e.setAttribute(n, n.toLowerCase())), n
        }
    }, V || (I = {
        name: !0,
        id: !0,
        coords: !0
    }, j = v.valHooks.button = {
        get: function (e, n) {
            var r;
            return r = e.getAttributeNode(n), r && (I[n] ? r.value !== "" : r.specified) ? r.value : t
        },
        set: function (e, t, n) {
            var r = e.getAttributeNode(n);
            return r || (r = i.createAttribute(n), e.setAttributeNode(r)), r.value = t + ""
        }
    }, v.each(["width", "height"], function (e, t) {
        v.attrHooks[t] = v.extend(v.attrHooks[t], {
            set: function (e, n) {
                if (n === "") return e.setAttribute(t, "auto"), n
            }
        })
    }), v.attrHooks.contenteditable = {
        get: j.get,
        set: function (e, t, n) {
            t === "" && (t = "false"), j.set(e, t, n)
        }
    }), v.support.hrefNormalized || v.each(["href", "src", "width", "height"], function (e, n) {
        v.attrHooks[n] = v.extend(v.attrHooks[n], {
            get: function (e) {
                var r = e.getAttribute(n, 2);
                return r === null ? t : r
            }
        })
    }), v.support.style || (v.attrHooks.style = {
        get: function (e) {
            return e.style.cssText.toLowerCase() || t
        },
        set: function (e, t) {
            return e.style.cssText = t + ""
        }
    }), v.support.optSelected || (v.propHooks.selected = v.extend(v.propHooks.selected, {
        get: function (e) {
            var t = e.parentNode;
            return t && (t.selectedIndex, t.parentNode && t.parentNode.selectedIndex), null
        }
    })), v.support.enctype || (v.propFix.enctype = "encoding"), v.support.checkOn || v.each(["radio", "checkbox"], function () {
        v.valHooks[this] = {
            get: function (e) {
                return e.getAttribute("value") === null ? "on" : e.value
            }
        }
    }), v.each(["radio", "checkbox"], function () {
        v.valHooks[this] = v.extend(v.valHooks[this], {
            set: function (e, t) {
                if (v.isArray(t)) return e.checked = v.inArray(v(e).val(), t) >= 0
            }
        })
    });
    var $ = /^(?:textarea|input|select)$/i,
        J = /^([^\.]*|)(?:\.(.+)|)$/,
        K = /(?:^|\s)hover(\.\S+|)\b/,
        Q = /^key/,
        G = /^(?:mouse|contextmenu)|click/,
        Y = /^(?:focusinfocus|focusoutblur)$/,
        Z = function (e) {
            return v.event.special.hover ? e : e.replace(K, "mouseenter$1 mouseleave$1")
        };
    v.event = {
        add: function (e, n, r, i, s) {
            var o, u, a, f, l, c, h, p, d, m, g;
            if (e.nodeType === 3 || e.nodeType === 8 || !n || !r || !(o = v._data(e))) return;
            r.handler && (d = r, r = d.handler, s = d.selector), r.guid || (r.guid = v.guid++), a = o.events, a || (o.events = a = {}), u = o.handle, u || (o.handle = u = function (e) {
                return typeof v == "undefined" || !! e && v.event.triggered === e.type ? t : v.event.dispatch.apply(u.elem, arguments)
            }, u.elem = e), n = v.trim(Z(n)).split(" ");
            for (f = 0; f < n.length; f++) {
                l = J.exec(n[f]) || [], c = l[1], h = (l[2] || "").split(".").sort(), g = v.event.special[c] || {}, c = (s ? g.delegateType : g.bindType) || c, g = v.event.special[c] || {}, p = v.extend({
                    type: c,
                    origType: l[1],
                    data: i,
                    handler: r,
                    guid: r.guid,
                    selector: s,
                    needsContext: s && v.expr.match.needsContext.test(s),
                    namespace: h.join(".")
                }, d), m = a[c];
                if (!m) {
                    m = a[c] = [], m.delegateCount = 0;
                    if (!g.setup || g.setup.call(e, i, h, u) === !1) e.addEventListener ? e.addEventListener(c, u, !1) : e.attachEvent && e.attachEvent("on" + c, u)
                }
                g.add && (g.add.call(e, p), p.handler.guid || (p.handler.guid = r.guid)), s ? m.splice(m.delegateCount++, 0, p) : m.push(p), v.event.global[c] = !0
            }
            e = null
        },
        global: {},
        remove: function (e, t, n, r, i) {
            var s, o, u, a, f, l, c, h, p, d, m, g = v.hasData(e) && v._data(e);
            if (!g || !(h = g.events)) return;
            t = v.trim(Z(t || "")).split(" ");
            for (s = 0; s < t.length; s++) {
                o = J.exec(t[s]) || [], u = a = o[1], f = o[2];
                if (!u) {
                    for (u in h) v.event.remove(e, u + t[s], n, r, !0);
                    continue
                }
                p = v.event.special[u] || {}, u = (r ? p.delegateType : p.bindType) || u, d = h[u] || [], l = d.length, f = f ? new RegExp("(^|\\.)" + f.split(".").sort().join("\\.(?:.*\\.|)") + "(\\.|$)") : null;
                for (c = 0; c < d.length; c++) m = d[c], (i || a === m.origType) && (!n || n.guid === m.guid) && (!f || f.test(m.namespace)) && (!r || r === m.selector || r === "**" && m.selector) && (d.splice(c--, 1), m.selector && d.delegateCount--, p.remove && p.remove.call(e, m));
                d.length === 0 && l !== d.length && ((!p.teardown || p.teardown.call(e, f, g.handle) === !1) && v.removeEvent(e, u, g.handle), delete h[u])
            }
            v.isEmptyObject(h) && (delete g.handle, v.removeData(e, "events", !0))
        },
        customEvent: {
            getData: !0,
            setData: !0,
            changeData: !0
        },
        trigger: function (n, r, s, o) {
            if (!s || s.nodeType !== 3 && s.nodeType !== 8) {
                var u, a, f, l, c, h, p, d, m, g, y = n.type || n,
                    b = [];
                if (Y.test(y + v.event.triggered)) return;
                y.indexOf("!") >= 0 && (y = y.slice(0, -1), a = !0), y.indexOf(".") >= 0 && (b = y.split("."), y = b.shift(), b.sort());
                if ((!s || v.event.customEvent[y]) && !v.event.global[y]) return;
                n = typeof n == "object" ? n[v.expando] ? n : new v.Event(y, n) : new v.Event(y), n.type = y, n.isTrigger = !0, n.exclusive = a, n.namespace = b.join("."), n.namespace_re = n.namespace ? new RegExp("(^|\\.)" + b.join("\\.(?:.*\\.|)") + "(\\.|$)") : null, h = y.indexOf(":") < 0 ? "on" + y : "";
                if (!s) {
                    u = v.cache;
                    for (f in u) u[f].events && u[f].events[y] && v.event.trigger(n, r, u[f].handle.elem, !0);
                    return
                }
                n.result = t, n.target || (n.target = s), r = r != null ? v.makeArray(r) : [], r.unshift(n), p = v.event.special[y] || {};
                if (p.trigger && p.trigger.apply(s, r) === !1) return;
                m = [
                    [s, p.bindType || y]
                ];
                if (!o && !p.noBubble && !v.isWindow(s)) {
                    g = p.delegateType || y, l = Y.test(g + y) ? s : s.parentNode;
                    for (c = s; l; l = l.parentNode) m.push([l, g]), c = l;
                    c === (s.ownerDocument || i) && m.push([c.defaultView || c.parentWindow || e, g])
                }
                for (f = 0; f < m.length && !n.isPropagationStopped(); f++) l = m[f][0], n.type = m[f][1], d = (v._data(l, "events") || {})[n.type] && v._data(l, "handle"), d && d.apply(l, r), d = h && l[h], d && v.acceptData(l) && d.apply && d.apply(l, r) === !1 && n.preventDefault();
                return n.type = y, !o && !n.isDefaultPrevented() && (!p._default || p._default.apply(s.ownerDocument, r) === !1) && (y !== "click" || !v.nodeName(s, "a")) && v.acceptData(s) && h && s[y] && (y !== "focus" && y !== "blur" || n.target.offsetWidth !== 0) && !v.isWindow(s) && (c = s[h], c && (s[h] = null), v.event.triggered = y, s[y](), v.event.triggered = t, c && (s[h] = c)), n.result
            }
            return
        },
        dispatch: function (n) {
            n = v.event.fix(n || e.event);
            var r, i, s, o, u, a, f, c, h, p, d = (v._data(this, "events") || {})[n.type] || [],
                m = d.delegateCount,
                g = l.call(arguments),
                y = !n.exclusive && !n.namespace,
                b = v.event.special[n.type] || {}, w = [];
            g[0] = n, n.delegateTarget = this;
            if (b.preDispatch && b.preDispatch.call(this, n) === !1) return;
            if (m && (!n.button || n.type !== "click"))
                for (s = n.target; s != this; s = s.parentNode || this)
                    if (s.disabled !== !0 || n.type !== "click") {
                        u = {}, f = [];
                        for (r = 0; r < m; r++) c = d[r], h = c.selector, u[h] === t && (u[h] = c.needsContext ? v(h, this).index(s) >= 0 : v.find(h, this, null, [s]).length), u[h] && f.push(c);
                        f.length && w.push({
                            elem: s,
                            matches: f
                        })
                    }
            d.length > m && w.push({
                elem: this,
                matches: d.slice(m)
            });
            for (r = 0; r < w.length && !n.isPropagationStopped(); r++) {
                a = w[r], n.currentTarget = a.elem;
                for (i = 0; i < a.matches.length && !n.isImmediatePropagationStopped(); i++) {
                    c = a.matches[i];
                    if (y || !n.namespace && !c.namespace || n.namespace_re && n.namespace_re.test(c.namespace)) n.data = c.data, n.handleObj = c, o = ((v.event.special[c.origType] || {}).handle || c.handler).apply(a.elem, g), o !== t && (n.result = o, o === !1 && (n.preventDefault(), n.stopPropagation()))
                }
            }
            return b.postDispatch && b.postDispatch.call(this, n), n.result
        },
        props: "attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),
        fixHooks: {},
        keyHooks: {
            props: "char charCode key keyCode".split(" "),
            filter: function (e, t) {
                return e.which == null && (e.which = t.charCode != null ? t.charCode : t.keyCode), e
            }
        },
        mouseHooks: {
            props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),
            filter: function (e, n) {
                var r, s, o, u = n.button,
                    a = n.fromElement;
                return e.pageX == null && n.clientX != null && (r = e.target.ownerDocument || i, s = r.documentElement, o = r.body, e.pageX = n.clientX + (s && s.scrollLeft || o && o.scrollLeft || 0) - (s && s.clientLeft || o && o.clientLeft || 0), e.pageY = n.clientY + (s && s.scrollTop || o && o.scrollTop || 0) - (s && s.clientTop || o && o.clientTop || 0)), !e.relatedTarget && a && (e.relatedTarget = a === e.target ? n.toElement : a), !e.which && u !== t && (e.which = u & 1 ? 1 : u & 2 ? 3 : u & 4 ? 2 : 0), e
            }
        },
        fix: function (e) {
            if (e[v.expando]) return e;
            var t, n, r = e,
                s = v.event.fixHooks[e.type] || {}, o = s.props ? this.props.concat(s.props) : this.props;
            e = v.Event(r);
            for (t = o.length; t;) n = o[--t], e[n] = r[n];
            return e.target || (e.target = r.srcElement || i), e.target.nodeType === 3 && (e.target = e.target.parentNode), e.metaKey = !! e.metaKey, s.filter ? s.filter(e, r) : e
        },
        special: {
            load: {
                noBubble: !0
            },
            focus: {
                delegateType: "focusin"
            },
            blur: {
                delegateType: "focusout"
            },
            beforeunload: {
                setup: function (e, t, n) {
                    v.isWindow(this) && (this.onbeforeunload = n)
                },
                teardown: function (e, t) {
                    this.onbeforeunload === t && (this.onbeforeunload = null)
                }
            }
        },
        simulate: function (e, t, n, r) {
            var i = v.extend(new v.Event, n, {
                type: e,
                isSimulated: !0,
                originalEvent: {}
            });
            r ? v.event.trigger(i, null, t) : v.event.dispatch.call(t, i), i.isDefaultPrevented() && n.preventDefault()
        }
    }, v.event.handle = v.event.dispatch, v.removeEvent = i.removeEventListener ? function (e, t, n) {
        e.removeEventListener && e.removeEventListener(t, n, !1)
    } : function (e, t, n) {
        var r = "on" + t;
        e.detachEvent && (typeof e[r] == "undefined" && (e[r] = null), e.detachEvent(r, n))
    }, v.Event = function (e, t) {
        if (!(this instanceof v.Event)) return new v.Event(e, t);
        e && e.type ? (this.originalEvent = e, this.type = e.type, this.isDefaultPrevented = e.defaultPrevented || e.returnValue === !1 || e.getPreventDefault && e.getPreventDefault() ? tt : et) : this.type = e, t && v.extend(this, t), this.timeStamp = e && e.timeStamp || v.now(), this[v.expando] = !0
    }, v.Event.prototype = {
        preventDefault: function () {
            this.isDefaultPrevented = tt;
            var e = this.originalEvent;
            if (!e) return;
            e.preventDefault ? e.preventDefault() : e.returnValue = !1
        },
        stopPropagation: function () {
            this.isPropagationStopped = tt;
            var e = this.originalEvent;
            if (!e) return;
            e.stopPropagation && e.stopPropagation(), e.cancelBubble = !0
        },
        stopImmediatePropagation: function () {
            this.isImmediatePropagationStopped = tt, this.stopPropagation()
        },
        isDefaultPrevented: et,
        isPropagationStopped: et,
        isImmediatePropagationStopped: et
    }, v.each({
        mouseenter: "mouseover",
        mouseleave: "mouseout"
    }, function (e, t) {
        v.event.special[e] = {
            delegateType: t,
            bindType: t,
            handle: function (e) {
                var n, r = this,
                    i = e.relatedTarget,
                    s = e.handleObj,
                    o = s.selector;
                if (!i || i !== r && !v.contains(r, i)) e.type = s.origType, n = s.handler.apply(this, arguments), e.type = t;
                return n
            }
        }
    }), v.support.submitBubbles || (v.event.special.submit = {
        setup: function () {
            if (v.nodeName(this, "form")) return !1;
            v.event.add(this, "click._submit keypress._submit", function (e) {
                var n = e.target,
                    r = v.nodeName(n, "input") || v.nodeName(n, "button") ? n.form : t;
                r && !v._data(r, "_submit_attached") && (v.event.add(r, "submit._submit", function (e) {
                    e._submit_bubble = !0
                }), v._data(r, "_submit_attached", !0))
            })
        },
        postDispatch: function (e) {
            e._submit_bubble && (delete e._submit_bubble, this.parentNode && !e.isTrigger && v.event.simulate("submit", this.parentNode, e, !0))
        },
        teardown: function () {
            if (v.nodeName(this, "form")) return !1;
            v.event.remove(this, "._submit")
        }
    }), v.support.changeBubbles || (v.event.special.change = {
        setup: function () {
            if ($.test(this.nodeName)) {
                if (this.type === "checkbox" || this.type === "radio") v.event.add(this, "propertychange._change", function (e) {
                    e.originalEvent.propertyName === "checked" && (this._just_changed = !0)
                }), v.event.add(this, "click._change", function (e) {
                    this._just_changed && !e.isTrigger && (this._just_changed = !1), v.event.simulate("change", this, e, !0)
                });
                return !1
            }
            v.event.add(this, "beforeactivate._change", function (e) {
                var t = e.target;
                $.test(t.nodeName) && !v._data(t, "_change_attached") && (v.event.add(t, "change._change", function (e) {
                    this.parentNode && !e.isSimulated && !e.isTrigger && v.event.simulate("change", this.parentNode, e, !0)
                }), v._data(t, "_change_attached", !0))
            })
        },
        handle: function (e) {
            var t = e.target;
            if (this !== t || e.isSimulated || e.isTrigger || t.type !== "radio" && t.type !== "checkbox") return e.handleObj.handler.apply(this, arguments)
        },
        teardown: function () {
            return v.event.remove(this, "._change"), !$.test(this.nodeName)
        }
    }), v.support.focusinBubbles || v.each({
        focus: "focusin",
        blur: "focusout"
    }, function (e, t) {
        var n = 0,
            r = function (e) {
                v.event.simulate(t, e.target, v.event.fix(e), !0)
            };
        v.event.special[t] = {
            setup: function () {
                n++ === 0 && i.addEventListener(e, r, !0)
            },
            teardown: function () {
                --n === 0 && i.removeEventListener(e, r, !0)
            }
        }
    }), v.fn.extend({
        on: function (e, n, r, i, s) {
            var o, u;
            if (typeof e == "object") {
                typeof n != "string" && (r = r || n, n = t);
                for (u in e) this.on(u, n, r, e[u], s);
                return this
            }
            r == null && i == null ? (i = n, r = n = t) : i == null && (typeof n == "string" ? (i = r, r = t) : (i = r, r = n, n = t));
            if (i === !1) i = et;
            else if (!i) return this;
            return s === 1 && (o = i, i = function (e) {
                return v().off(e), o.apply(this, arguments)
            }, i.guid = o.guid || (o.guid = v.guid++)), this.each(function () {
                v.event.add(this, e, i, r, n)
            })
        },
        one: function (e, t, n, r) {
            return this.on(e, t, n, r, 1)
        },
        off: function (e, n, r) {
            var i, s;
            if (e && e.preventDefault && e.handleObj) return i = e.handleObj, v(e.delegateTarget).off(i.namespace ? i.origType + "." + i.namespace : i.origType, i.selector, i.handler), this;
            if (typeof e == "object") {
                for (s in e) this.off(s, n, e[s]);
                return this
            }
            if (n === !1 || typeof n == "function") r = n, n = t;
            return r === !1 && (r = et), this.each(function () {
                v.event.remove(this, e, r, n)
            })
        },
        bind: function (e, t, n) {
            return this.on(e, null, t, n)
        },
        unbind: function (e, t) {
            return this.off(e, null, t)
        },
        live: function (e, t, n) {
            return v(this.context).on(e, this.selector, t, n), this
        },
        die: function (e, t) {
            return v(this.context).off(e, this.selector || "**", t), this
        },
        delegate: function (e, t, n, r) {
            return this.on(t, e, n, r)
        },
        undelegate: function (e, t, n) {
            return arguments.length === 1 ? this.off(e, "**") : this.off(t, e || "**", n)
        },
        trigger: function (e, t) {
            return this.each(function () {
                v.event.trigger(e, t, this)
            })
        },
        triggerHandler: function (e, t) {
            if (this[0]) return v.event.trigger(e, t, this[0], !0)
        },
        toggle: function (e) {
            var t = arguments,
                n = e.guid || v.guid++,
                r = 0,
                i = function (n) {
                    var i = (v._data(this, "lastToggle" + e.guid) || 0) % r;
                    return v._data(this, "lastToggle" + e.guid, i + 1), n.preventDefault(), t[i].apply(this, arguments) || !1
                };
            i.guid = n;
            while (r < t.length) t[r++].guid = n;
            return this.click(i)
        },
        hover: function (e, t) {
            return this.mouseenter(e).mouseleave(t || e)
        }
    }), v.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "), function (e, t) {
        v.fn[t] = function (e, n) {
            return n == null && (n = e, e = null), arguments.length > 0 ? this.on(t, null, e, n) : this.trigger(t)
        }, Q.test(t) && (v.event.fixHooks[t] = v.event.keyHooks), G.test(t) && (v.event.fixHooks[t] = v.event.mouseHooks)
    }),
    function (e, t) {
        function nt(e, t, n, r) {
            n = n || [], t = t || g;
            var i, s, a, f, l = t.nodeType;
            if (!e || typeof e != "string") return n;
            if (l !== 1 && l !== 9) return [];
            a = o(t);
            if (!a && !r)
                if (i = R.exec(e))
                    if (f = i[1]) {
                        if (l === 9) {
                            s = t.getElementById(f);
                            if (!s || !s.parentNode) return n;
                            if (s.id === f) return n.push(s), n
                        } else if (t.ownerDocument && (s = t.ownerDocument.getElementById(f)) && u(t, s) && s.id === f) return n.push(s), n
                    } else {
                        if (i[2]) return S.apply(n, x.call(t.getElementsByTagName(e), 0)), n;
                        if ((f = i[3]) && Z && t.getElementsByClassName) return S.apply(n, x.call(t.getElementsByClassName(f), 0)), n
                    }
            return vt(e.replace(j, "$1"), t, n, r, a)
        }

        function rt(e) {
            return function (t) {
                var n = t.nodeName.toLowerCase();
                return n === "input" && t.type === e
            }
        }

        function it(e) {
            return function (t) {
                var n = t.nodeName.toLowerCase();
                return (n === "input" || n === "button") && t.type === e
            }
        }

        function st(e) {
            return N(function (t) {
                return t = +t, N(function (n, r) {
                    var i, s = e([], n.length, t),
                        o = s.length;
                    while (o--) n[i = s[o]] && (n[i] = !(r[i] = n[i]))
                })
            })
        }

        function ot(e, t, n) {
            if (e === t) return n;
            var r = e.nextSibling;
            while (r) {
                if (r === t) return -1;
                r = r.nextSibling
            }
            return 1
        }

        function ut(e, t) {
            var n, r, s, o, u, a, f, l = L[d][e];
            if (l) return t ? 0 : l.slice(0);
            u = e, a = [], f = i.preFilter;
            while (u) {
                if (!n || (r = F.exec(u))) r && (u = u.slice(r[0].length)), a.push(s = []);
                n = !1;
                if (r = I.exec(u)) s.push(n = new m(r.shift())), u = u.slice(n.length), n.type = r[0].replace(j, " ");
                for (o in i.filter)(r = J[o].exec(u)) && (!f[o] || (r = f[o](r, g, !0))) && (s.push(n = new m(r.shift())), u = u.slice(n.length), n.type = o, n.matches = r);
                if (!n) break
            }
            return t ? u.length : u ? nt.error(e) : L(e, a).slice(0)
        }

        function at(e, t, r) {
            var i = t.dir,
                s = r && t.dir === "parentNode",
                o = w++;
            return t.first ? function (t, n, r) {
                while (t = t[i])
                    if (s || t.nodeType === 1) return e(t, n, r)
            } : function (t, r, u) {
                if (!u) {
                    var a, f = b + " " + o + " ",
                        l = f + n;
                    while (t = t[i])
                        if (s || t.nodeType === 1) {
                            if ((a = t[d]) === l) return t.sizset;
                            if (typeof a == "string" && a.indexOf(f) === 0) {
                                if (t.sizset) return t
                            } else {
                                t[d] = l;
                                if (e(t, r, u)) return t.sizset = !0, t;
                                t.sizset = !1
                            }
                        }
                } else
                    while (t = t[i])
                        if (s || t.nodeType === 1)
                            if (e(t, r, u)) return t
            }
        }

        function ft(e) {
            return e.length > 1 ? function (t, n, r) {
                var i = e.length;
                while (i--)
                    if (!e[i](t, n, r)) return !1;
                return !0
            } : e[0]
        }

        function lt(e, t, n, r, i) {
            var s, o = [],
                u = 0,
                a = e.length,
                f = t != null;
            for (; u < a; u++)
                if (s = e[u])
                    if (!n || n(s, r, i)) o.push(s), f && t.push(u);
            return o
        }

        function ct(e, t, n, r, i, s) {
            return r && !r[d] && (r = ct(r)), i && !i[d] && (i = ct(i, s)), N(function (s, o, u, a) {
                if (s && i) return;
                var f, l, c, h = [],
                    p = [],
                    d = o.length,
                    v = s || dt(t || "*", u.nodeType ? [u] : u, [], s),
                    m = e && (s || !t) ? lt(v, h, e, u, a) : v,
                    g = n ? i || (s ? e : d || r) ? [] : o : m;
                n && n(m, g, u, a);
                if (r) {
                    c = lt(g, p), r(c, [], u, a), f = c.length;
                    while (f--)
                        if (l = c[f]) g[p[f]] = !(m[p[f]] = l)
                }
                if (s) {
                    f = e && g.length;
                    while (f--)
                        if (l = g[f]) s[h[f]] = !(o[h[f]] = l)
                } else g = lt(g === o ? g.splice(d, g.length) : g), i ? i(null, o, g, a) : S.apply(o, g)
            })
        }

        function ht(e) {
            var t, n, r, s = e.length,
                o = i.relative[e[0].type],
                u = o || i.relative[" "],
                a = o ? 1 : 0,
                f = at(function (e) {
                    return e === t
                }, u, !0),
                l = at(function (e) {
                    return T.call(t, e) > -1
                }, u, !0),
                h = [
                    function (e, n, r) {
                        return !o && (r || n !== c) || ((t = n).nodeType ? f(e, n, r) : l(e, n, r))
                    }
                ];
            for (; a < s; a++)
                if (n = i.relative[e[a].type]) h = [at(ft(h), n)];
                else {
                    n = i.filter[e[a].type].apply(null, e[a].matches);
                    if (n[d]) {
                        r = ++a;
                        for (; r < s; r++)
                            if (i.relative[e[r].type]) break;
                        return ct(a > 1 && ft(h), a > 1 && e.slice(0, a - 1).join("").replace(j, "$1"), n, a < r && ht(e.slice(a, r)), r < s && ht(e = e.slice(r)), r < s && e.join(""))
                    }
                    h.push(n)
                }
            return ft(h)
        }

        function pt(e, t) {
            var r = t.length > 0,
                s = e.length > 0,
                o = function (u, a, f, l, h) {
                    var p, d, v, m = [],
                        y = 0,
                        w = "0",
                        x = u && [],
                        T = h != null,
                        N = c,
                        C = u || s && i.find.TAG("*", h && a.parentNode || a),
                        k = b += N == null ? 1 : Math.E;
                    T && (c = a !== g && a, n = o.el);
                    for (;
                        (p = C[w]) != null; w++) {
                        if (s && p) {
                            for (d = 0; v = e[d]; d++)
                                if (v(p, a, f)) {
                                    l.push(p);
                                    break
                                }
                            T && (b = k, n = ++o.el)
                        }
                        r && ((p = !v && p) && y--, u && x.push(p))
                    }
                    y += w;
                    if (r && w !== y) {
                        for (d = 0; v = t[d]; d++) v(x, m, a, f);
                        if (u) {
                            if (y > 0)
                                while (w--)!x[w] && !m[w] && (m[w] = E.call(l));
                            m = lt(m)
                        }
                        S.apply(l, m), T && !u && m.length > 0 && y + t.length > 1 && nt.uniqueSort(l)
                    }
                    return T && (b = k, c = N), x
                };
            return o.el = 0, r ? N(o) : o
        }

        function dt(e, t, n, r) {
            var i = 0,
                s = t.length;
            for (; i < s; i++) nt(e, t[i], n, r);
            return n
        }

        function vt(e, t, n, r, s) {
            var o, u, f, l, c, h = ut(e),
                p = h.length;
            if (!r && h.length === 1) {
                u = h[0] = h[0].slice(0);
                if (u.length > 2 && (f = u[0]).type === "ID" && t.nodeType === 9 && !s && i.relative[u[1].type]) {
                    t = i.find.ID(f.matches[0].replace($, ""), t, s)[0];
                    if (!t) return n;
                    e = e.slice(u.shift().length)
                }
                for (o = J.POS.test(e) ? -1 : u.length - 1; o >= 0; o--) {
                    f = u[o];
                    if (i.relative[l = f.type]) break;
                    if (c = i.find[l])
                        if (r = c(f.matches[0].replace($, ""), z.test(u[0].type) && t.parentNode || t, s)) {
                            u.splice(o, 1), e = r.length && u.join("");
                            if (!e) return S.apply(n, x.call(r, 0)), n;
                            break
                        }
                }
            }
            return a(e, h)(r, t, s, n, z.test(e)), n
        }

        function mt() {}
        var n, r, i, s, o, u, a, f, l, c, h = !0,
            p = "undefined",
            d = ("sizcache" + Math.random()).replace(".", ""),
            m = String,
            g = e.document,
            y = g.documentElement,
            b = 0,
            w = 0,
            E = [].pop,
            S = [].push,
            x = [].slice,
            T = [].indexOf || function (e) {
                var t = 0,
                    n = this.length;
                for (; t < n; t++)
                    if (this[t] === e) return t;
                return -1
            }, N = function (e, t) {
                return e[d] = t == null || t, e
            }, C = function () {
                var e = {}, t = [];
                return N(function (n, r) {
                    return t.push(n) > i.cacheLength && delete e[t.shift()], e[n] = r
                }, e)
            }, k = C(),
            L = C(),
            A = C(),
            O = "[\\x20\\t\\r\\n\\f]",
            M = "(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+",
            _ = M.replace("w", "w#"),
            D = "([*^$|!~]?=)",
            P = "\\[" + O + "*(" + M + ")" + O + "*(?:" + D + O + "*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|(" + _ + ")|)|)" + O + "*\\]",
            H = ":(" + M + ")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|([^()[\\]]*|(?:(?:" + P + ")|[^:]|\\\\.)*|.*))\\)|)",
            B = ":(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + O + "*((?:-\\d)?\\d*)" + O + "*\\)|)(?=[^-]|$)",
            j = new RegExp("^" + O + "+|((?:^|[^\\\\])(?:\\\\.)*)" + O + "+$", "g"),
            F = new RegExp("^" + O + "*," + O + "*"),
            I = new RegExp("^" + O + "*([\\x20\\t\\r\\n\\f>+~])" + O + "*"),
            q = new RegExp(H),
            R = /^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,
            U = /^:not/,
            z = /[\x20\t\r\n\f]*[+~]/,
            W = /:not\($/,
            X = /h\d/i,
            V = /input|select|textarea|button/i,
            $ = /\\(?!\\)/g,
            J = {
                ID: new RegExp("^#(" + M + ")"),
                CLASS: new RegExp("^\\.(" + M + ")"),
                NAME: new RegExp("^\\[name=['\"]?(" + M + ")['\"]?\\]"),
                TAG: new RegExp("^(" + M.replace("w", "w*") + ")"),
                ATTR: new RegExp("^" + P),
                PSEUDO: new RegExp("^" + H),
                POS: new RegExp(B, "i"),
                CHILD: new RegExp("^:(only|nth|first|last)-child(?:\\(" + O + "*(even|odd|(([+-]|)(\\d*)n|)" + O + "*(?:([+-]|)" + O + "*(\\d+)|))" + O + "*\\)|)", "i"),
                needsContext: new RegExp("^" + O + "*[>+~]|" + B, "i")
            }, K = function (e) {
                var t = g.createElement("div");
                try {
                    return e(t)
                } catch (n) {
                    return !1
                } finally {
                    t = null
                }
            }, Q = K(function (e) {
                return e.appendChild(g.createComment("")), !e.getElementsByTagName("*").length
            }),
            G = K(function (e) {
                return e.innerHTML = "<a href='#'></a>", e.firstChild && typeof e.firstChild.getAttribute !== p && e.firstChild.getAttribute("href") === "#"
            }),
            Y = K(function (e) {
                e.innerHTML = "<select></select>";
                var t = typeof e.lastChild.getAttribute("multiple");
                return t !== "boolean" && t !== "string"
            }),
            Z = K(function (e) {
                return e.innerHTML = "<div class='hidden e'></div><div class='hidden'></div>", !e.getElementsByClassName || !e.getElementsByClassName("e").length ? !1 : (e.lastChild.className = "e", e.getElementsByClassName("e").length === 2)
            }),
            et = K(function (e) {
                e.id = d + 0, e.innerHTML = "<a name='" + d + "'></a><div name='" + d + "'></div>", y.insertBefore(e, y.firstChild);
                var t = g.getElementsByName && g.getElementsByName(d).length === 2 + g.getElementsByName(d + 0).length;
                return r = !g.getElementById(d), y.removeChild(e), t
            });
        try {
            x.call(y.childNodes, 0)[0].nodeType
        } catch (tt) {
            x = function (e) {
                var t, n = [];
                for (; t = this[e]; e++) n.push(t);
                return n
            }
        }
        nt.matches = function (e, t) {
            return nt(e, null, null, t)
        }, nt.matchesSelector = function (e, t) {
            return nt(t, null, null, [e]).length > 0
        }, s = nt.getText = function (e) {
            var t, n = "",
                r = 0,
                i = e.nodeType;
            if (i) {
                if (i === 1 || i === 9 || i === 11) {
                    if (typeof e.textContent == "string") return e.textContent;
                    for (e = e.firstChild; e; e = e.nextSibling) n += s(e)
                } else if (i === 3 || i === 4) return e.nodeValue
            } else
                for (; t = e[r]; r++) n += s(t);
            return n
        }, o = nt.isXML = function (e) {
            var t = e && (e.ownerDocument || e).documentElement;
            return t ? t.nodeName !== "HTML" : !1
        }, u = nt.contains = y.contains ? function (e, t) {
            var n = e.nodeType === 9 ? e.documentElement : e,
                r = t && t.parentNode;
            return e === r || !! (r && r.nodeType === 1 && n.contains && n.contains(r))
        } : y.compareDocumentPosition ? function (e, t) {
            return t && !! (e.compareDocumentPosition(t) & 16)
        } : function (e, t) {
            while (t = t.parentNode)
                if (t === e) return !0;
            return !1
        }, nt.attr = function (e, t) {
            var n, r = o(e);
            return r || (t = t.toLowerCase()), (n = i.attrHandle[t]) ? n(e) : r || Y ? e.getAttribute(t) : (n = e.getAttributeNode(t), n ? typeof e[t] == "boolean" ? e[t] ? t : null : n.specified ? n.value : null : null)
        }, i = nt.selectors = {
            cacheLength: 50,
            createPseudo: N,
            match: J,
            attrHandle: G ? {} : {
                href: function (e) {
                    return e.getAttribute("href", 2)
                },
                type: function (e) {
                    return e.getAttribute("type")
                }
            },
            find: {
                ID: r ? function (e, t, n) {
                    if (typeof t.getElementById !== p && !n) {
                        var r = t.getElementById(e);
                        return r && r.parentNode ? [r] : []
                    }
                } : function (e, n, r) {
                    if (typeof n.getElementById !== p && !r) {
                        var i = n.getElementById(e);
                        return i ? i.id === e || typeof i.getAttributeNode !== p && i.getAttributeNode("id").value === e ? [i] : t : []
                    }
                },
                TAG: Q ? function (e, t) {
                    if (typeof t.getElementsByTagName !== p) return t.getElementsByTagName(e)
                } : function (e, t) {
                    var n = t.getElementsByTagName(e);
                    if (e === "*") {
                        var r, i = [],
                            s = 0;
                        for (; r = n[s]; s++) r.nodeType === 1 && i.push(r);
                        return i
                    }
                    return n
                },
                NAME: et && function (e, t) {
                    if (typeof t.getElementsByName !== p) return t.getElementsByName(name)
                },
                CLASS: Z && function (e, t, n) {
                    if (typeof t.getElementsByClassName !== p && !n) return t.getElementsByClassName(e)
                }
            },
            relative: {
                ">": {
                    dir: "parentNode",
                    first: !0
                },
                " ": {
                    dir: "parentNode"
                },
                "+": {
                    dir: "previousSibling",
                    first: !0
                },
                "~": {
                    dir: "previousSibling"
                }
            },
            preFilter: {
                ATTR: function (e) {
                    return e[1] = e[1].replace($, ""), e[3] = (e[4] || e[5] || "").replace($, ""), e[2] === "~=" && (e[3] = " " + e[3] + " "), e.slice(0, 4)
                },
                CHILD: function (e) {
                    return e[1] = e[1].toLowerCase(), e[1] === "nth" ? (e[2] || nt.error(e[0]), e[3] = +(e[3] ? e[4] + (e[5] || 1) : 2 * (e[2] === "even" || e[2] === "odd")), e[4] = +(e[6] + e[7] || e[2] === "odd")) : e[2] && nt.error(e[0]), e
                },
                PSEUDO: function (e) {
                    var t, n;
                    if (J.CHILD.test(e[0])) return null;
                    if (e[3]) e[2] = e[3];
                    else if (t = e[4]) q.test(t) && (n = ut(t, !0)) && (n = t.indexOf(")", t.length - n) - t.length) && (t = t.slice(0, n), e[0] = e[0].slice(0, n)), e[2] = t;
                    return e.slice(0, 3)
                }
            },
            filter: {
                ID: r ? function (e) {
                    return e = e.replace($, ""),
                    function (t) {
                        return t.getAttribute("id") === e
                    }
                } : function (e) {
                    return e = e.replace($, ""),
                    function (t) {
                        var n = typeof t.getAttributeNode !== p && t.getAttributeNode("id");
                        return n && n.value === e
                    }
                },
                TAG: function (e) {
                    return e === "*" ? function () {
                        return !0
                    } : (e = e.replace($, "").toLowerCase(), function (t) {
                        return t.nodeName && t.nodeName.toLowerCase() === e
                    })
                },
                CLASS: function (e) {
                    var t = k[d][e];
                    return t || (t = k(e, new RegExp("(^|" + O + ")" + e + "(" + O + "|$)"))),
                    function (e) {
                        return t.test(e.className || typeof e.getAttribute !== p && e.getAttribute("class") || "")
                    }
                },
                ATTR: function (e, t, n) {
                    return function (r, i) {
                        var s = nt.attr(r, e);
                        return s == null ? t === "!=" : t ? (s += "", t === "=" ? s === n : t === "!=" ? s !== n : t === "^=" ? n && s.indexOf(n) === 0 : t === "*=" ? n && s.indexOf(n) > -1 : t === "$=" ? n && s.substr(s.length - n.length) === n : t === "~=" ? (" " + s + " ").indexOf(n) > -1 : t === "|=" ? s === n || s.substr(0, n.length + 1) === n + "-" : !1) : !0
                    }
                },
                CHILD: function (e, t, n, r) {
                    return e === "nth" ? function (e) {
                        var t, i, s = e.parentNode;
                        if (n === 1 && r === 0) return !0;
                        if (s) {
                            i = 0;
                            for (t = s.firstChild; t; t = t.nextSibling)
                                if (t.nodeType === 1) {
                                    i++;
                                    if (e === t) break
                                }
                        }
                        return i -= r, i === n || i % n === 0 && i / n >= 0
                    } : function (t) {
                        var n = t;
                        switch (e) {
                        case "only":
                        case "first":
                            while (n = n.previousSibling)
                                if (n.nodeType === 1) return !1;
                            if (e === "first") return !0;
                            n = t;
                        case "last":
                            while (n = n.nextSibling)
                                if (n.nodeType === 1) return !1;
                            return !0
                        }
                    }
                },
                PSEUDO: function (e, t) {
                    var n, r = i.pseudos[e] || i.setFilters[e.toLowerCase()] || nt.error("unsupported pseudo: " + e);
                    return r[d] ? r(t) : r.length > 1 ? (n = [e, e, "", t], i.setFilters.hasOwnProperty(e.toLowerCase()) ? N(function (e, n) {
                        var i, s = r(e, t),
                            o = s.length;
                        while (o--) i = T.call(e, s[o]), e[i] = !(n[i] = s[o])
                    }) : function (e) {
                        return r(e, 0, n)
                    }) : r
                }
            },
            pseudos: {
                not: N(function (e) {
                    var t = [],
                        n = [],
                        r = a(e.replace(j, "$1"));
                    return r[d] ? N(function (e, t, n, i) {
                        var s, o = r(e, null, i, []),
                            u = e.length;
                        while (u--)
                            if (s = o[u]) e[u] = !(t[u] = s)
                    }) : function (e, i, s) {
                        return t[0] = e, r(t, null, s, n), !n.pop()
                    }
                }),
                has: N(function (e) {
                    return function (t) {
                        return nt(e, t).length > 0
                    }
                }),
                contains: N(function (e) {
                    return function (t) {
                        return (t.textContent || t.innerText || s(t)).indexOf(e) > -1
                    }
                }),
                enabled: function (e) {
                    return e.disabled === !1
                },
                disabled: function (e) {
                    return e.disabled === !0
                },
                checked: function (e) {
                    var t = e.nodeName.toLowerCase();
                    return t === "input" && !! e.checked || t === "option" && !! e.selected
                },
                selected: function (e) {
                    return e.parentNode && e.parentNode.selectedIndex, e.selected === !0
                },
                parent: function (e) {
                    return !i.pseudos.empty(e)
                },
                empty: function (e) {
                    var t;
                    e = e.firstChild;
                    while (e) {
                        if (e.nodeName > "@" || (t = e.nodeType) === 3 || t === 4) return !1;
                        e = e.nextSibling
                    }
                    return !0
                },
                header: function (e) {
                    return X.test(e.nodeName)
                },
                text: function (e) {
                    var t, n;
                    return e.nodeName.toLowerCase() === "input" && (t = e.type) === "text" && ((n = e.getAttribute("type")) == null || n.toLowerCase() === t)
                },
                radio: rt("radio"),
                checkbox: rt("checkbox"),
                file: rt("file"),
                password: rt("password"),
                image: rt("image"),
                submit: it("submit"),
                reset: it("reset"),
                button: function (e) {
                    var t = e.nodeName.toLowerCase();
                    return t === "input" && e.type === "button" || t === "button"
                },
                input: function (e) {
                    return V.test(e.nodeName)
                },
                focus: function (e) {
                    var t = e.ownerDocument;
                    return e === t.activeElement && (!t.hasFocus || t.hasFocus()) && ( !! e.type || !! e.href)
                },
                active: function (e) {
                    return e === e.ownerDocument.activeElement
                },
                first: st(function (e, t, n) {
                    return [0]
                }),
                last: st(function (e, t, n) {
                    return [t - 1]
                }),
                eq: st(function (e, t, n) {
                    return [n < 0 ? n + t : n]
                }),
                even: st(function (e, t, n) {
                    for (var r = 0; r < t; r += 2) e.push(r);
                    return e
                }),
                odd: st(function (e, t, n) {
                    for (var r = 1; r < t; r += 2) e.push(r);
                    return e
                }),
                lt: st(function (e, t, n) {
                    for (var r = n < 0 ? n + t : n; --r >= 0;) e.push(r);
                    return e
                }),
                gt: st(function (e, t, n) {
                    for (var r = n < 0 ? n + t : n; ++r < t;) e.push(r);
                    return e
                })
            }
        }, f = y.compareDocumentPosition ? function (e, t) {
            return e === t ? (l = !0, 0) : (!e.compareDocumentPosition || !t.compareDocumentPosition ? e.compareDocumentPosition : e.compareDocumentPosition(t) & 4) ? -1 : 1
        } : function (e, t) {
            if (e === t) return l = !0, 0;
            if (e.sourceIndex && t.sourceIndex) return e.sourceIndex - t.sourceIndex;
            var n, r, i = [],
                s = [],
                o = e.parentNode,
                u = t.parentNode,
                a = o;
            if (o === u) return ot(e, t);
            if (!o) return -1;
            if (!u) return 1;
            while (a) i.unshift(a), a = a.parentNode;
            a = u;
            while (a) s.unshift(a), a = a.parentNode;
            n = i.length, r = s.length;
            for (var f = 0; f < n && f < r; f++)
                if (i[f] !== s[f]) return ot(i[f], s[f]);
            return f === n ? ot(e, s[f], -1) : ot(i[f], t, 1)
        }, [0, 0].sort(f), h = !l, nt.uniqueSort = function (e) {
            var t, n = 1;
            l = h, e.sort(f);
            if (l)
                for (; t = e[n]; n++) t === e[n - 1] && e.splice(n--, 1);
            return e
        }, nt.error = function (e) {
            throw new Error("Syntax error, unrecognized expression: " + e)
        }, a = nt.compile = function (e, t) {
            var n, r = [],
                i = [],
                s = A[d][e];
            if (!s) {
                t || (t = ut(e)), n = t.length;
                while (n--) s = ht(t[n]), s[d] ? r.push(s) : i.push(s);
                s = A(e, pt(i, r))
            }
            return s
        }, g.querySelectorAll && function () {
            var e, t = vt,
                n = /'|\\/g,
                r = /\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,
                i = [":focus"],
                s = [":active", ":focus"],
                u = y.matchesSelector || y.mozMatchesSelector || y.webkitMatchesSelector || y.oMatchesSelector || y.msMatchesSelector;
            K(function (e) {
                e.innerHTML = "<select><option selected=''></option></select>", e.querySelectorAll("[selected]").length || i.push("\\[" + O + "*(?:checked|disabled|ismap|multiple|readonly|selected|value)"), e.querySelectorAll(":checked").length || i.push(":checked")
            }), K(function (e) {
                e.innerHTML = "<p test=''></p>", e.querySelectorAll("[test^='']").length && i.push("[*^$]=" + O + "*(?:\"\"|'')"), e.innerHTML = "<input type='hidden'/>", e.querySelectorAll(":enabled").length || i.push(":enabled", ":disabled")
            }), i = new RegExp(i.join("|")), vt = function (e, r, s, o, u) {
                if (!o && !u && (!i || !i.test(e))) {
                    var a, f, l = !0,
                        c = d,
                        h = r,
                        p = r.nodeType === 9 && e;
                    if (r.nodeType === 1 && r.nodeName.toLowerCase() !== "object") {
                        a = ut(e), (l = r.getAttribute("id")) ? c = l.replace(n, "\\$&") : r.setAttribute("id", c), c = "[id='" + c + "'] ", f = a.length;
                        while (f--) a[f] = c + a[f].join("");
                        h = z.test(e) && r.parentNode || r, p = a.join(",")
                    }
                    if (p) try {
                        return S.apply(s, x.call(h.querySelectorAll(p), 0)), s
                    } catch (v) {} finally {
                        l || r.removeAttribute("id")
                    }
                }
                return t(e, r, s, o, u)
            }, u && (K(function (t) {
                e = u.call(t, "div");
                try {
                    u.call(t, "[test!='']:sizzle"), s.push("!=", H)
                } catch (n) {}
            }), s = new RegExp(s.join("|")), nt.matchesSelector = function (t, n) {
                n = n.replace(r, "='$1']");
                if (!o(t) && !s.test(n) && (!i || !i.test(n))) try {
                    var a = u.call(t, n);
                    if (a || e || t.document && t.document.nodeType !== 11) return a
                } catch (f) {}
                return nt(n, null, null, [t]).length > 0
            })
        }(), i.pseudos.nth = i.pseudos.eq, i.filters = mt.prototype = i.pseudos, i.setFilters = new mt, nt.attr = v.attr, v.find = nt, v.expr = nt.selectors, v.expr[":"] = v.expr.pseudos, v.unique = nt.uniqueSort, v.text = nt.getText, v.isXMLDoc = nt.isXML, v.contains = nt.contains
    }(e);
    var nt = /Until$/,
        rt = /^(?:parents|prev(?:Until|All))/,
        it = /^.[^:#\[\.,]*$/,
        st = v.expr.match.needsContext,
        ot = {
            children: !0,
            contents: !0,
            next: !0,
            prev: !0
        };
    v.fn.extend({
        find: function (e) {
            var t, n, r, i, s, o, u = this;
            if (typeof e != "string") return v(e).filter(function () {
                for (t = 0, n = u.length; t < n; t++)
                    if (v.contains(u[t], this)) return !0
            });
            o = this.pushStack("", "find", e);
            for (t = 0, n = this.length; t < n; t++) {
                r = o.length, v.find(e, this[t], o);
                if (t > 0)
                    for (i = r; i < o.length; i++)
                        for (s = 0; s < r; s++)
                            if (o[s] === o[i]) {
                                o.splice(i--, 1);
                                break
                            }
            }
            return o
        },
        has: function (e) {
            var t, n = v(e, this),
                r = n.length;
            return this.filter(function () {
                for (t = 0; t < r; t++)
                    if (v.contains(this, n[t])) return !0
            })
        },
        not: function (e) {
            return this.pushStack(ft(this, e, !1), "not", e)
        },
        filter: function (e) {
            return this.pushStack(ft(this, e, !0), "filter", e)
        },
        is: function (e) {
            return !!e && (typeof e == "string" ? st.test(e) ? v(e, this.context).index(this[0]) >= 0 : v.filter(e, this).length > 0 : this.filter(e).length > 0)
        },
        closest: function (e, t) {
            var n, r = 0,
                i = this.length,
                s = [],
                o = st.test(e) || typeof e != "string" ? v(e, t || this.context) : 0;
            for (; r < i; r++) {
                n = this[r];
                while (n && n.ownerDocument && n !== t && n.nodeType !== 11) {
                    if (o ? o.index(n) > -1 : v.find.matchesSelector(n, e)) {
                        s.push(n);
                        break
                    }
                    n = n.parentNode
                }
            }
            return s = s.length > 1 ? v.unique(s) : s, this.pushStack(s, "closest", e)
        },
        index: function (e) {
            return e ? typeof e == "string" ? v.inArray(this[0], v(e)) : v.inArray(e.jquery ? e[0] : e, this) : this[0] && this[0].parentNode ? this.prevAll().length : -1
        },
        add: function (e, t) {
            var n = typeof e == "string" ? v(e, t) : v.makeArray(e && e.nodeType ? [e] : e),
                r = v.merge(this.get(), n);
            return this.pushStack(ut(n[0]) || ut(r[0]) ? r : v.unique(r))
        },
        addBack: function (e) {
            return this.add(e == null ? this.prevObject : this.prevObject.filter(e))
        }
    }), v.fn.andSelf = v.fn.addBack, v.each({
        parent: function (e) {
            var t = e.parentNode;
            return t && t.nodeType !== 11 ? t : null
        },
        parents: function (e) {
            return v.dir(e, "parentNode")
        },
        parentsUntil: function (e, t, n) {
            return v.dir(e, "parentNode", n)
        },
        next: function (e) {
            return at(e, "nextSibling")
        },
        prev: function (e) {
            return at(e, "previousSibling")
        },
        nextAll: function (e) {
            return v.dir(e, "nextSibling")
        },
        prevAll: function (e) {
            return v.dir(e, "previousSibling")
        },
        nextUntil: function (e, t, n) {
            return v.dir(e, "nextSibling", n)
        },
        prevUntil: function (e, t, n) {
            return v.dir(e, "previousSibling", n)
        },
        siblings: function (e) {
            return v.sibling((e.parentNode || {}).firstChild, e)
        },
        children: function (e) {
            return v.sibling(e.firstChild)
        },
        contents: function (e) {
            return v.nodeName(e, "iframe") ? e.contentDocument || e.contentWindow.document : v.merge([], e.childNodes)
        }
    }, function (e, t) {
        v.fn[e] = function (n, r) {
            var i = v.map(this, t, n);
            return nt.test(e) || (r = n), r && typeof r == "string" && (i = v.filter(r, i)), i = this.length > 1 && !ot[e] ? v.unique(i) : i, this.length > 1 && rt.test(e) && (i = i.reverse()), this.pushStack(i, e, l.call(arguments).join(","))
        }
    }), v.extend({
        filter: function (e, t, n) {
            return n && (e = ":not(" + e + ")"), t.length === 1 ? v.find.matchesSelector(t[0], e) ? [t[0]] : [] : v.find.matches(e, t)
        },
        dir: function (e, n, r) {
            var i = [],
                s = e[n];
            while (s && s.nodeType !== 9 && (r === t || s.nodeType !== 1 || !v(s).is(r))) s.nodeType === 1 && i.push(s), s = s[n];
            return i
        },
        sibling: function (e, t) {
            var n = [];
            for (; e; e = e.nextSibling) e.nodeType === 1 && e !== t && n.push(e);
            return n
        }
    });
    var ct = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",
        ht = / jQuery\d+="(?:null|\d+)"/g,
        pt = /^\s+/,
        dt = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,
        vt = /<([\w:]+)/,
        mt = /<tbody/i,
        gt = /<|&#?\w+;/,
        yt = /<(?:script|style|link)/i,
        bt = /<(?:script|object|embed|option|style)/i,
        wt = new RegExp("<(?:" + ct + ")[\\s/>]", "i"),
        Et = /^(?:checkbox|radio)$/,
        St = /checked\s*(?:[^=]|=\s*.checked.)/i,
        xt = /\/(java|ecma)script/i,
        Tt = /^\s*<!(?:\[CDATA\[|\-\-)|[\]\-]{2}>\s*$/g,
        Nt = {
            option: [1, "<select multiple='multiple'>", "</select>"],
            legend: [1, "<fieldset>", "</fieldset>"],
            thead: [1, "<table>", "</table>"],
            tr: [2, "<table><tbody>", "</tbody></table>"],
            td: [3, "<table><tbody><tr>", "</tr></tbody></table>"],
            col: [2, "<table><tbody></tbody><colgroup>", "</colgroup></table>"],
            area: [1, "<map>", "</map>"],
            _default: [0, "", ""]
        }, Ct = lt(i),
        kt = Ct.appendChild(i.createElement("div"));
    Nt.optgroup = Nt.option, Nt.tbody = Nt.tfoot = Nt.colgroup = Nt.caption = Nt.thead, Nt.th = Nt.td, v.support.htmlSerialize || (Nt._default = [1, "X<div>", "</div>"]), v.fn.extend({
        text: function (e) {
            return v.access(this, function (e) {
                return e === t ? v.text(this) : this.empty().append((this[0] && this[0].ownerDocument || i).createTextNode(e))
            }, null, e, arguments.length)
        },
        wrapAll: function (e) {
            if (v.isFunction(e)) return this.each(function (t) {
                v(this).wrapAll(e.call(this, t))
            });
            if (this[0]) {
                var t = v(e, this[0].ownerDocument).eq(0).clone(!0);
                this[0].parentNode && t.insertBefore(this[0]), t.map(function () {
                    var e = this;
                    while (e.firstChild && e.firstChild.nodeType === 1) e = e.firstChild;
                    return e
                }).append(this)
            }
            return this
        },
        wrapInner: function (e) {
            return v.isFunction(e) ? this.each(function (t) {
                v(this).wrapInner(e.call(this, t))
            }) : this.each(function () {
                var t = v(this),
                    n = t.contents();
                n.length ? n.wrapAll(e) : t.append(e)
            })
        },
        wrap: function (e) {
            var t = v.isFunction(e);
            return this.each(function (n) {
                v(this).wrapAll(t ? e.call(this, n) : e)
            })
        },
        unwrap: function () {
            return this.parent().each(function () {
                v.nodeName(this, "body") || v(this).replaceWith(this.childNodes)
            }).end()
        },
        append: function () {
            return this.domManip(arguments, !0, function (e) {
                (this.nodeType === 1 || this.nodeType === 11) && this.appendChild(e)
            })
        },
        prepend: function () {
            return this.domManip(arguments, !0, function (e) {
                (this.nodeType === 1 || this.nodeType === 11) && this.insertBefore(e, this.firstChild)
            })
        },
        before: function () {
            if (!ut(this[0])) return this.domManip(arguments, !1, function (e) {
                this.parentNode.insertBefore(e, this)
            });
            if (arguments.length) {
                var e = v.clean(arguments);
                return this.pushStack(v.merge(e, this), "before", this.selector)
            }
        },
        after: function () {
            if (!ut(this[0])) return this.domManip(arguments, !1, function (e) {
                this.parentNode.insertBefore(e, this.nextSibling)
            });
            if (arguments.length) {
                var e = v.clean(arguments);
                return this.pushStack(v.merge(this, e), "after", this.selector)
            }
        },
        remove: function (e, t) {
            var n, r = 0;
            for (;
                (n = this[r]) != null; r++)
                if (!e || v.filter(e, [n]).length)!t && n.nodeType === 1 && (v.cleanData(n.getElementsByTagName("*")), v.cleanData([n])), n.parentNode && n.parentNode.removeChild(n);
            return this
        },
        empty: function () {
            var e, t = 0;
            for (;
                (e = this[t]) != null; t++) {
                e.nodeType === 1 && v.cleanData(e.getElementsByTagName("*"));
                while (e.firstChild) e.removeChild(e.firstChild)
            }
            return this
        },
        clone: function (e, t) {
            return e = e == null ? !1 : e, t = t == null ? e : t, this.map(function () {
                return v.clone(this, e, t)
            })
        },
        html: function (e) {
            return v.access(this, function (e) {
                var n = this[0] || {}, r = 0,
                    i = this.length;
                if (e === t) return n.nodeType === 1 ? n.innerHTML.replace(ht, "") : t;
                if (typeof e == "string" && !yt.test(e) && (v.support.htmlSerialize || !wt.test(e)) && (v.support.leadingWhitespace || !pt.test(e)) && !Nt[(vt.exec(e) || ["", ""])[1].toLowerCase()]) {
                    e = e.replace(dt, "<$1></$2>");
                    try {
                        for (; r < i; r++) n = this[r] || {}, n.nodeType === 1 && (v.cleanData(n.getElementsByTagName("*")), n.innerHTML = e);
                        n = 0
                    } catch (s) {}
                }
                n && this.empty().append(e)
            }, null, e, arguments.length)
        },
        replaceWith: function (e) {
            return ut(this[0]) ? this.length ? this.pushStack(v(v.isFunction(e) ? e() : e), "replaceWith", e) : this : v.isFunction(e) ? this.each(function (t) {
                var n = v(this),
                    r = n.html();
                n.replaceWith(e.call(this, t, r))
            }) : (typeof e != "string" && (e = v(e).detach()), this.each(function () {
                var t = this.nextSibling,
                    n = this.parentNode;
                v(this).remove(), t ? v(t).before(e) : v(n).append(e)
            }))
        },
        detach: function (e) {
            return this.remove(e, !0)
        },
        domManip: function (e, n, r) {
            e = [].concat.apply([], e);
            var i, s, o, u, a = 0,
                f = e[0],
                l = [],
                c = this.length;
            if (!v.support.checkClone && c > 1 && typeof f == "string" && St.test(f)) return this.each(function () {
                v(this).domManip(e, n, r)
            });
            if (v.isFunction(f)) return this.each(function (i) {
                var s = v(this);
                e[0] = f.call(this, i, n ? s.html() : t), s.domManip(e, n, r)
            });
            if (this[0]) {
                i = v.buildFragment(e, this, l), o = i.fragment, s = o.firstChild, o.childNodes.length === 1 && (o = s);
                if (s) {
                    n = n && v.nodeName(s, "tr");
                    for (u = i.cacheable || c - 1; a < c; a++) r.call(n && v.nodeName(this[a], "table") ? Lt(this[a], "tbody") : this[a], a === u ? o : v.clone(o, !0, !0))
                }
                o = s = null, l.length && v.each(l, function (e, t) {
                    t.src ? v.ajax ? v.ajax({
                        url: t.src,
                        type: "GET",
                        dataType: "script",
                        async: !1,
                        global: !1,
                        "throws": !0
                    }) : v.error("no ajax") : v.globalEval((t.text || t.textContent || t.innerHTML || "").replace(Tt, "")), t.parentNode && t.parentNode.removeChild(t)
                })
            }
            return this
        }
    }), v.buildFragment = function (e, n, r) {
        var s, o, u, a = e[0];
        return n = n || i, n = !n.nodeType && n[0] || n, n = n.ownerDocument || n, e.length === 1 && typeof a == "string" && a.length < 512 && n === i && a.charAt(0) === "<" && !bt.test(a) && (v.support.checkClone || !St.test(a)) && (v.support.html5Clone || !wt.test(a)) && (o = !0, s = v.fragments[a], u = s !== t), s || (s = n.createDocumentFragment(), v.clean(e, n, s, r), o && (v.fragments[a] = u && s)), {
            fragment: s,
            cacheable: o
        }
    }, v.fragments = {}, v.each({
        appendTo: "append",
        prependTo: "prepend",
        insertBefore: "before",
        insertAfter: "after",
        replaceAll: "replaceWith"
    }, function (e, t) {
        v.fn[e] = function (n) {
            var r, i = 0,
                s = [],
                o = v(n),
                u = o.length,
                a = this.length === 1 && this[0].parentNode;
            if ((a == null || a && a.nodeType === 11 && a.childNodes.length === 1) && u === 1) return o[t](this[0]), this;
            for (; i < u; i++) r = (i > 0 ? this.clone(!0) : this).get(), v(o[i])[t](r), s = s.concat(r);
            return this.pushStack(s, e, o.selector)
        }
    }), v.extend({
        clone: function (e, t, n) {
            var r, i, s, o;
            v.support.html5Clone || v.isXMLDoc(e) || !wt.test("<" + e.nodeName + ">") ? o = e.cloneNode(!0) : (kt.innerHTML = e.outerHTML, kt.removeChild(o = kt.firstChild));
            if ((!v.support.noCloneEvent || !v.support.noCloneChecked) && (e.nodeType === 1 || e.nodeType === 11) && !v.isXMLDoc(e)) {
                Ot(e, o), r = Mt(e), i = Mt(o);
                for (s = 0; r[s]; ++s) i[s] && Ot(r[s], i[s])
            }
            if (t) {
                At(e, o);
                if (n) {
                    r = Mt(e), i = Mt(o);
                    for (s = 0; r[s]; ++s) At(r[s], i[s])
                }
            }
            return r = i = null, o
        },
        clean: function (e, t, n, r) {
            var s, o, u, a, f, l, c, h, p, d, m, g, y = t === i && Ct,
                b = [];
            if (!t || typeof t.createDocumentFragment == "undefined") t = i;
            for (s = 0;
                (u = e[s]) != null; s++) {
                typeof u == "number" && (u += "");
                if (!u) continue;
                if (typeof u == "string")
                    if (!gt.test(u)) u = t.createTextNode(u);
                    else {
                        y = y || lt(t), c = t.createElement("div"), y.appendChild(c), u = u.replace(dt, "<$1></$2>"), a = (vt.exec(u) || ["", ""])[1].toLowerCase(), f = Nt[a] || Nt._default, l = f[0], c.innerHTML = f[1] + u + f[2];
                        while (l--) c = c.lastChild;
                        if (!v.support.tbody) {
                            h = mt.test(u), p = a === "table" && !h ? c.firstChild && c.firstChild.childNodes : f[1] === "<table>" && !h ? c.childNodes : [];
                            for (o = p.length - 1; o >= 0; --o) v.nodeName(p[o], "tbody") && !p[o].childNodes.length && p[o].parentNode.removeChild(p[o])
                        }!v.support.leadingWhitespace && pt.test(u) && c.insertBefore(t.createTextNode(pt.exec(u)[0]), c.firstChild), u = c.childNodes, c.parentNode.removeChild(c)
                    }
                u.nodeType ? b.push(u) : v.merge(b, u)
            }
            c && (u = c = y = null);
            if (!v.support.appendChecked)
                for (s = 0;
                    (u = b[s]) != null; s++) v.nodeName(u, "input") ? _t(u) : typeof u.getElementsByTagName != "undefined" && v.grep(u.getElementsByTagName("input"), _t);
            if (n) {
                m = function (e) {
                    if (!e.type || xt.test(e.type)) return r ? r.push(e.parentNode ? e.parentNode.removeChild(e) : e) : n.appendChild(e)
                };
                for (s = 0;
                    (u = b[s]) != null; s++)
                    if (!v.nodeName(u, "script") || !m(u)) n.appendChild(u), typeof u.getElementsByTagName != "undefined" && (g = v.grep(v.merge([], u.getElementsByTagName("script")), m), b.splice.apply(b, [s + 1, 0].concat(g)), s += g.length)
            }
            return b
        },
        cleanData: function (e, t) {
            var n, r, i, s, o = 0,
                u = v.expando,
                a = v.cache,
                f = v.support.deleteExpando,
                l = v.event.special;
            for (;
                (i = e[o]) != null; o++)
                if (t || v.acceptData(i)) {
                    r = i[u], n = r && a[r];
                    if (n) {
                        if (n.events)
                            for (s in n.events) l[s] ? v.event.remove(i, s) : v.removeEvent(i, s, n.handle);
                        a[r] && (delete a[r], f ? delete i[u] : i.removeAttribute ? i.removeAttribute(u) : i[u] = null, v.deletedIds.push(r))
                    }
                }
        }
    }),
    function () {
        var e, t;
        v.uaMatch = function (e) {
            e = e.toLowerCase();
            var t = /(chrome)[ \/]([\w.]+)/.exec(e) || /(webkit)[ \/]([\w.]+)/.exec(e) || /(opera)(?:.*version|)[ \/]([\w.]+)/.exec(e) || /(msie) ([\w.]+)/.exec(e) || e.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(e) || [];
            return {
                browser: t[1] || "",
                version: t[2] || "0"
            }
        }, e = v.uaMatch(o.userAgent), t = {}, e.browser && (t[e.browser] = !0, t.version = e.version), t.chrome ? t.webkit = !0 : t.webkit && (t.safari = !0), v.browser = t, v.sub = function () {
            function e(t, n) {
                return new e.fn.init(t, n)
            }
            v.extend(!0, e, this), e.superclass = this, e.fn = e.prototype = this(), e.fn.constructor = e, e.sub = this.sub, e.fn.init = function (r, i) {
                return i && i instanceof v && !(i instanceof e) && (i = e(i)), v.fn.init.call(this, r, i, t)
            }, e.fn.init.prototype = e.fn;
            var t = e(i);
            return e
        }
    }();
    var Dt, Pt, Ht, Bt = /alpha\([^)]*\)/i,
        jt = /opacity=([^)]*)/,
        Ft = /^(top|right|bottom|left)$/,
        It = /^(none|table(?!-c[ea]).+)/,
        qt = /^margin/,
        Rt = new RegExp("^(" + m + ")(.*)$", "i"),
        Ut = new RegExp("^(" + m + ")(?!px)[a-z%]+$", "i"),
        zt = new RegExp("^([-+])=(" + m + ")", "i"),
        Wt = {}, Xt = {
            position: "absolute",
            visibility: "hidden",
            display: "block"
        }, Vt = {
            letterSpacing: 0,
            fontWeight: 400
        }, $t = ["Top", "Right", "Bottom", "Left"],
        Jt = ["Webkit", "O", "Moz", "ms"],
        Kt = v.fn.toggle;
    v.fn.extend({
        css: function (e, n) {
            return v.access(this, function (e, n, r) {
                return r !== t ? v.style(e, n, r) : v.css(e, n)
            }, e, n, arguments.length > 1)
        },
        show: function () {
            return Yt(this, !0)
        },
        hide: function () {
            return Yt(this)
        },
        toggle: function (e, t) {
            var n = typeof e == "boolean";
            return v.isFunction(e) && v.isFunction(t) ? Kt.apply(this, arguments) : this.each(function () {
                (n ? e : Gt(this)) ? v(this).show() : v(this).hide()
            })
        }
    }), v.extend({
        cssHooks: {
            opacity: {
                get: function (e, t) {
                    if (t) {
                        var n = Dt(e, "opacity");
                        return n === "" ? "1" : n
                    }
                }
            }
        },
        cssNumber: {
            fillOpacity: !0,
            fontWeight: !0,
            lineHeight: !0,
            opacity: !0,
            orphans: !0,
            widows: !0,
            zIndex: !0,
            zoom: !0
        },
        cssProps: {
            "float": v.support.cssFloat ? "cssFloat" : "styleFloat"
        },
        style: function (e, n, r, i) {
            if (!e || e.nodeType === 3 || e.nodeType === 8 || !e.style) return;
            var s, o, u, a = v.camelCase(n),
                f = e.style;
            n = v.cssProps[a] || (v.cssProps[a] = Qt(f, a)), u = v.cssHooks[n] || v.cssHooks[a];
            if (r === t) return u && "get" in u && (s = u.get(e, !1, i)) !== t ? s : f[n];
            o = typeof r, o === "string" && (s = zt.exec(r)) && (r = (s[1] + 1) * s[2] + parseFloat(v.css(e, n)), o = "number");
            if (r == null || o === "number" && isNaN(r)) return;
            o === "number" && !v.cssNumber[a] && (r += "px");
            if (!u || !("set" in u) || (r = u.set(e, r, i)) !== t) try {
                f[n] = r
            } catch (l) {}
        },
        css: function (e, n, r, i) {
            var s, o, u, a = v.camelCase(n);
            return n = v.cssProps[a] || (v.cssProps[a] = Qt(e.style, a)), u = v.cssHooks[n] || v.cssHooks[a], u && "get" in u && (s = u.get(e, !0, i)), s === t && (s = Dt(e, n)), s === "normal" && n in Vt && (s = Vt[n]), r || i !== t ? (o = parseFloat(s), r || v.isNumeric(o) ? o || 0 : s) : s
        },
        swap: function (e, t, n) {
            var r, i, s = {};
            for (i in t) s[i] = e.style[i], e.style[i] = t[i];
            r = n.call(e);
            for (i in t) e.style[i] = s[i];
            return r
        }
    }), e.getComputedStyle ? Dt = function (t, n) {
        var r, i, s, o, u = e.getComputedStyle(t, null),
            a = t.style;
        return u && (r = u[n], r === "" && !v.contains(t.ownerDocument, t) && (r = v.style(t, n)), Ut.test(r) && qt.test(n) && (i = a.width, s = a.minWidth, o = a.maxWidth, a.minWidth = a.maxWidth = a.width = r, r = u.width, a.width = i, a.minWidth = s, a.maxWidth = o)), r
    } : i.documentElement.currentStyle && (Dt = function (e, t) {
        var n, r, i = e.currentStyle && e.currentStyle[t],
            s = e.style;
        return i == null && s && s[t] && (i = s[t]), Ut.test(i) && !Ft.test(t) && (n = s.left, r = e.runtimeStyle && e.runtimeStyle.left, r && (e.runtimeStyle.left = e.currentStyle.left), s.left = t === "fontSize" ? "1em" : i, i = s.pixelLeft + "px", s.left = n, r && (e.runtimeStyle.left = r)), i === "" ? "auto" : i
    }), v.each(["height", "width"], function (e, t) {
        v.cssHooks[t] = {
            get: function (e, n, r) {
                if (n) return e.offsetWidth === 0 && It.test(Dt(e, "display")) ? v.swap(e, Xt, function () {
                    return tn(e, t, r)
                }) : tn(e, t, r)
            },
            set: function (e, n, r) {
                return Zt(e, n, r ? en(e, t, r, v.support.boxSizing && v.css(e, "boxSizing") === "border-box") : 0)
            }
        }
    }), v.support.opacity || (v.cssHooks.opacity = {
        get: function (e, t) {
            return jt.test((t && e.currentStyle ? e.currentStyle.filter : e.style.filter) || "") ? .01 * parseFloat(RegExp.$1) + "" : t ? "1" : ""
        },
        set: function (e, t) {
            var n = e.style,
                r = e.currentStyle,
                i = v.isNumeric(t) ? "alpha(opacity=" + t * 100 + ")" : "",
                s = r && r.filter || n.filter || "";
            n.zoom = 1;
            if (t >= 1 && v.trim(s.replace(Bt, "")) === "" && n.removeAttribute) {
                n.removeAttribute("filter");
                if (r && !r.filter) return
            }
            n.filter = Bt.test(s) ? s.replace(Bt, i) : s + " " + i
        }
    }), v(function () {
        v.support.reliableMarginRight || (v.cssHooks.marginRight = {
            get: function (e, t) {
                return v.swap(e, {
                    display: "inline-block"
                }, function () {
                    if (t) return Dt(e, "marginRight")
                })
            }
        }), !v.support.pixelPosition && v.fn.position && v.each(["top", "left"], function (e, t) {
            v.cssHooks[t] = {
                get: function (e, n) {
                    if (n) {
                        var r = Dt(e, t);
                        return Ut.test(r) ? v(e).position()[t] + "px" : r
                    }
                }
            }
        })
    }), v.expr && v.expr.filters && (v.expr.filters.hidden = function (e) {
        return e.offsetWidth === 0 && e.offsetHeight === 0 || !v.support.reliableHiddenOffsets && (e.style && e.style.display || Dt(e, "display")) === "none"
    }, v.expr.filters.visible = function (e) {
        return !v.expr.filters.hidden(e)
    }), v.each({
        margin: "",
        padding: "",
        border: "Width"
    }, function (e, t) {
        v.cssHooks[e + t] = {
            expand: function (n) {
                var r, i = typeof n == "string" ? n.split(" ") : [n],
                    s = {};
                for (r = 0; r < 4; r++) s[e + $t[r] + t] = i[r] || i[r - 2] || i[0];
                return s
            }
        }, qt.test(e) || (v.cssHooks[e + t].set = Zt)
    });
    var rn = /%20/g,
        sn = /\[\]$/,
        on = /\r?\n/g,
        un = /^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,
        an = /^(?:select|textarea)/i;
    v.fn.extend({
        serialize: function () {
            return v.param(this.serializeArray())
        },
        serializeArray: function () {
            return this.map(function () {
                return this.elements ? v.makeArray(this.elements) : this
            }).filter(function () {
                return this.name && !this.disabled && (this.checked || an.test(this.nodeName) || un.test(this.type))
            }).map(function (e, t) {
                var n = v(this).val();
                return n == null ? null : v.isArray(n) ? v.map(n, function (e, n) {
                    return {
                        name: t.name,
                        value: e.replace(on, "\r\n")
                    }
                }) : {
                    name: t.name,
                    value: n.replace(on, "\r\n")
                }
            }).get()
        }
    }), v.param = function (e, n) {
        var r, i = [],
            s = function (e, t) {
                t = v.isFunction(t) ? t() : t == null ? "" : t, i[i.length] = encodeURIComponent(e) + "=" + encodeURIComponent(t)
            };
        n === t && (n = v.ajaxSettings && v.ajaxSettings.traditional);
        if (v.isArray(e) || e.jquery && !v.isPlainObject(e)) v.each(e, function () {
            s(this.name, this.value)
        });
        else
            for (r in e) fn(r, e[r], n, s);
        return i.join("&").replace(rn, "+")
    };
    var ln, cn, hn = /#.*$/,
        pn = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg,
        dn = /^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,
        vn = /^(?:GET|HEAD)$/,
        mn = /^\/\//,
        gn = /\?/,
        yn = /<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,
        bn = /([?&])_=[^&]*/,
        wn = /^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,
        En = v.fn.load,
        Sn = {}, xn = {}, Tn = ["*/"] + ["*"];
    try {
        cn = s.href
    } catch (Nn) {
        cn = i.createElement("a"), cn.href = "", cn = cn.href
    }
    ln = wn.exec(cn.toLowerCase()) || [], v.fn.load = function (e, n, r) {
        if (typeof e != "string" && En) return En.apply(this, arguments);
        if (!this.length) return this;
        var i, s, o, u = this,
            a = e.indexOf(" ");
        return a >= 0 && (i = e.slice(a, e.length), e = e.slice(0, a)), v.isFunction(n) ? (r = n, n = t) : n && typeof n == "object" && (s = "POST"), v.ajax({
            url: e,
            type: s,
            dataType: "html",
            data: n,
            complete: function (e, t) {
                r && u.each(r, o || [e.responseText, t, e])
            }
        }).done(function (e) {
            o = arguments, u.html(i ? v("<div>").append(e.replace(yn, "")).find(i) : e)
        }), this
    }, v.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "), function (e, t) {
        v.fn[t] = function (e) {
            return this.on(t, e)
        }
    }), v.each(["get", "post"], function (e, n) {
        v[n] = function (e, r, i, s) {
            return v.isFunction(r) && (s = s || i, i = r, r = t), v.ajax({
                type: n,
                url: e,
                data: r,
                success: i,
                dataType: s
            })
        }
    }), v.extend({
        getScript: function (e, n) {
            return v.get(e, t, n, "script")
        },
        getJSON: function (e, t, n) {
            return v.get(e, t, n, "json")
        },
        ajaxSetup: function (e, t) {
            return t ? Ln(e, v.ajaxSettings) : (t = e, e = v.ajaxSettings), Ln(e, t), e
        },
        ajaxSettings: {
            url: cn,
            isLocal: dn.test(ln[1]),
            global: !0,
            type: "GET",
            contentType: "application/x-www-form-urlencoded; charset=UTF-8",
            processData: !0,
            async: !0,
            accepts: {
                xml: "application/xml, text/xml",
                html: "text/html",
                text: "text/plain",
                json: "application/json, text/javascript",
                "*": Tn
            },
            contents: {
                xml: /xml/,
                html: /html/,
                json: /json/
            },
            responseFields: {
                xml: "responseXML",
                text: "responseText"
            },
            converters: {
                "* text": e.String,
                "text html": !0,
                "text json": v.parseJSON,
                "text xml": v.parseXML
            },
            flatOptions: {
                context: !0,
                url: !0
            }
        },
        ajaxPrefilter: Cn(Sn),
        ajaxTransport: Cn(xn),
        ajax: function (e, n) {
            function T(e, n, s, a) {
                var l, y, b, w, S, T = n;
                if (E === 2) return;
                E = 2, u && clearTimeout(u), o = t, i = a || "", x.readyState = e > 0 ? 4 : 0, s && (w = An(c, x, s));
                if (e >= 200 && e < 300 || e === 304) c.ifModified && (S = x.getResponseHeader("Last-Modified"), S && (v.lastModified[r] = S), S = x.getResponseHeader("Etag"), S && (v.etag[r] = S)), e === 304 ? (T = "notmodified", l = !0) : (l = On(c, w), T = l.state, y = l.data, b = l.error, l = !b);
                else {
                    b = T;
                    if (!T || e) T = "error", e < 0 && (e = 0)
                }
                x.status = e, x.statusText = (n || T) + "", l ? d.resolveWith(h, [y, T, x]) : d.rejectWith(h, [x, T, b]), x.statusCode(g), g = t, f && p.trigger("ajax" + (l ? "Success" : "Error"), [x, c, l ? y : b]), m.fireWith(h, [x, T]), f && (p.trigger("ajaxComplete", [x, c]), --v.active || v.event.trigger("ajaxStop"))
            }
            typeof e == "object" && (n = e, e = t), n = n || {};
            var r, i, s, o, u, a, f, l, c = v.ajaxSetup({}, n),
                h = c.context || c,
                p = h !== c && (h.nodeType || h instanceof v) ? v(h) : v.event,
                d = v.Deferred(),
                m = v.Callbacks("once memory"),
                g = c.statusCode || {}, b = {}, w = {}, E = 0,
                S = "canceled",
                x = {
                    readyState: 0,
                    setRequestHeader: function (e, t) {
                        if (!E) {
                            var n = e.toLowerCase();
                            e = w[n] = w[n] || e, b[e] = t
                        }
                        return this
                    },
                    getAllResponseHeaders: function () {
                        return E === 2 ? i : null
                    },
                    getResponseHeader: function (e) {
                        var n;
                        if (E === 2) {
                            if (!s) {
                                s = {};
                                while (n = pn.exec(i)) s[n[1].toLowerCase()] = n[2]
                            }
                            n = s[e.toLowerCase()]
                        }
                        return n === t ? null : n
                    },
                    overrideMimeType: function (e) {
                        return E || (c.mimeType = e), this
                    },
                    abort: function (e) {
                        return e = e || S, o && o.abort(e), T(0, e), this
                    }
                };
            d.promise(x), x.success = x.done, x.error = x.fail, x.complete = m.add, x.statusCode = function (e) {
                if (e) {
                    var t;
                    if (E < 2)
                        for (t in e) g[t] = [g[t], e[t]];
                    else t = e[x.status], x.always(t)
                }
                return this
            }, c.url = ((e || c.url) + "").replace(hn, "").replace(mn, ln[1] + "//"), c.dataTypes = v.trim(c.dataType || "*").toLowerCase().split(y), c.crossDomain == null && (a = wn.exec(c.url.toLowerCase()) || !1, c.crossDomain = a && a.join(":") + (a[3] ? "" : a[1] === "http:" ? 80 : 443) !== ln.join(":") + (ln[3] ? "" : ln[1] === "http:" ? 80 : 443)), c.data && c.processData && typeof c.data != "string" && (c.data = v.param(c.data, c.traditional)), kn(Sn, c, n, x);
            if (E === 2) return x;
            f = c.global, c.type = c.type.toUpperCase(), c.hasContent = !vn.test(c.type), f && v.active++ === 0 && v.event.trigger("ajaxStart");
            if (!c.hasContent) {
                c.data && (c.url += (gn.test(c.url) ? "&" : "?") + c.data, delete c.data), r = c.url;
                if (c.cache === !1) {
                    var N = v.now(),
                        C = c.url.replace(bn, "$1_=" + N);
                    c.url = C + (C === c.url ? (gn.test(c.url) ? "&" : "?") + "_=" + N : "")
                }
            }(c.data && c.hasContent && c.contentType !== !1 || n.contentType) && x.setRequestHeader("Content-Type", c.contentType), c.ifModified && (r = r || c.url, v.lastModified[r] && x.setRequestHeader("If-Modified-Since", v.lastModified[r]), v.etag[r] && x.setRequestHeader("If-None-Match", v.etag[r])), x.setRequestHeader("Accept", c.dataTypes[0] && c.accepts[c.dataTypes[0]] ? c.accepts[c.dataTypes[0]] + (c.dataTypes[0] !== "*" ? ", " + Tn + "; q=0.01" : "") : c.accepts["*"]);
            for (l in c.headers) x.setRequestHeader(l, c.headers[l]);
            if (!c.beforeSend || c.beforeSend.call(h, x, c) !== !1 && E !== 2) {
                S = "abort";
                for (l in {
                    success: 1,
                    error: 1,
                    complete: 1
                }) x[l](c[l]);
                o = kn(xn, c, n, x);
                if (!o) T(-1, "No Transport");
                else {
                    x.readyState = 1, f && p.trigger("ajaxSend", [x, c]), c.async && c.timeout > 0 && (u = setTimeout(function () {
                        x.abort("timeout")
                    }, c.timeout));
                    try {
                        E = 1, o.send(b, T)
                    } catch (k) {
                        if (!(E < 2)) throw k;
                        T(-1, k)
                    }
                }
                return x
            }
            return x.abort()
        },
        active: 0,
        lastModified: {},
        etag: {}
    });
    var Mn = [],
        _n = /\?/,
        Dn = /(=)\?(?=&|$)|\?\?/,
        Pn = v.now();
    v.ajaxSetup({
        jsonp: "callback",
        jsonpCallback: function () {
            var e = Mn.pop() || v.expando + "_" + Pn++;
            return this[e] = !0, e
        }
    }), v.ajaxPrefilter("json jsonp", function (n, r, i) {
        var s, o, u, a = n.data,
            f = n.url,
            l = n.jsonp !== !1,
            c = l && Dn.test(f),
            h = l && !c && typeof a == "string" && !(n.contentType || "").indexOf("application/x-www-form-urlencoded") && Dn.test(a);
        if (n.dataTypes[0] === "jsonp" || c || h) return s = n.jsonpCallback = v.isFunction(n.jsonpCallback) ? n.jsonpCallback() : n.jsonpCallback, o = e[s], c ? n.url = f.replace(Dn, "$1" + s) : h ? n.data = a.replace(Dn, "$1" + s) : l && (n.url += (_n.test(f) ? "&" : "?") + n.jsonp + "=" + s), n.converters["script json"] = function () {
            return u || v.error(s + " was not called"), u[0]
        }, n.dataTypes[0] = "json", e[s] = function () {
            u = arguments
        }, i.always(function () {
            e[s] = o, n[s] && (n.jsonpCallback = r.jsonpCallback, Mn.push(s)), u && v.isFunction(o) && o(u[0]), u = o = t
        }), "script"
    }), v.ajaxSetup({
        accepts: {
            script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
        },
        contents: {
            script: /javascript|ecmascript/
        },
        converters: {
            "text script": function (e) {
                return v.globalEval(e), e
            }
        }
    }), v.ajaxPrefilter("script", function (e) {
        e.cache === t && (e.cache = !1), e.crossDomain && (e.type = "GET", e.global = !1)
    }), v.ajaxTransport("script", function (e) {
        if (e.crossDomain) {
            var n, r = i.head || i.getElementsByTagName("head")[0] || i.documentElement;
            return {
                send: function (s, o) {
                    n = i.createElement("script"), n.async = "async", e.scriptCharset && (n.charset = e.scriptCharset), n.src = e.url, n.onload = n.onreadystatechange = function (e, i) {
                        if (i || !n.readyState || /loaded|complete/.test(n.readyState)) n.onload = n.onreadystatechange = null, r && n.parentNode && r.removeChild(n), n = t, i || o(200, "success")
                    }, r.insertBefore(n, r.firstChild)
                },
                abort: function () {
                    n && n.onload(0, 1)
                }
            }
        }
    });
    var Hn, Bn = e.ActiveXObject ? function () {
            for (var e in Hn) Hn[e](0, 1)
        } : !1,
        jn = 0;
    v.ajaxSettings.xhr = e.ActiveXObject ? function () {
        return !this.isLocal && Fn() || In()
    } : Fn,
    function (e) {
        v.extend(v.support, {
            ajax: !! e,
            cors: !! e && "withCredentials" in e
        })
    }(v.ajaxSettings.xhr()), v.support.ajax && v.ajaxTransport(function (n) {
        if (!n.crossDomain || v.support.cors) {
            var r;
            return {
                send: function (i, s) {
                    var o, u, a = n.xhr();
                    n.username ? a.open(n.type, n.url, n.async, n.username, n.password) : a.open(n.type, n.url, n.async);
                    if (n.xhrFields)
                        for (u in n.xhrFields) a[u] = n.xhrFields[u];
                    n.mimeType && a.overrideMimeType && a.overrideMimeType(n.mimeType), !n.crossDomain && !i["X-Requested-With"] && (i["X-Requested-With"] = "XMLHttpRequest");
                    try {
                        for (u in i) a.setRequestHeader(u, i[u])
                    } catch (f) {}
                    a.send(n.hasContent && n.data || null), r = function (e, i) {
                        var u, f, l, c, h;
                        try {
                            if (r && (i || a.readyState === 4)) {
                                r = t, o && (a.onreadystatechange = v.noop, Bn && delete Hn[o]);
                                if (i) a.readyState !== 4 && a.abort();
                                else {
                                    u = a.status, l = a.getAllResponseHeaders(), c = {}, h = a.responseXML, h && h.documentElement && (c.xml = h);
                                    try {
                                        c.text = a.responseText
                                    } catch (e) {}
                                    try {
                                        f = a.statusText
                                    } catch (p) {
                                        f = ""
                                    }!u && n.isLocal && !n.crossDomain ? u = c.text ? 200 : 404 : u === 1223 && (u = 204)
                                }
                            }
                        } catch (d) {
                            i || s(-1, d)
                        }
                        c && s(u, f, c, l)
                    }, n.async ? a.readyState === 4 ? setTimeout(r, 0) : (o = ++jn, Bn && (Hn || (Hn = {}, v(e).unload(Bn)), Hn[o] = r), a.onreadystatechange = r) : r()
                },
                abort: function () {
                    r && r(0, 1)
                }
            }
        }
    });
    var qn, Rn, Un = /^(?:toggle|show|hide)$/,
        zn = new RegExp("^(?:([-+])=|)(" + m + ")([a-z%]*)$", "i"),
        Wn = /queueHooks$/,
        Xn = [Gn],
        Vn = {
            "*": [
                function (e, t) {
                    var n, r, i = this.createTween(e, t),
                        s = zn.exec(t),
                        o = i.cur(),
                        u = +o || 0,
                        a = 1,
                        f = 20;
                    if (s) {
                        n = +s[2], r = s[3] || (v.cssNumber[e] ? "" : "px");
                        if (r !== "px" && u) {
                            u = v.css(i.elem, e, !0) || n || 1;
                            do a = a || ".5", u /= a, v.style(i.elem, e, u + r); while (a !== (a = i.cur() / o) && a !== 1 && --f)
                        }
                        i.unit = r, i.start = u, i.end = s[1] ? u + (s[1] + 1) * n : n
                    }
                    return i
                }
            ]
        };
    v.Animation = v.extend(Kn, {
        tweener: function (e, t) {
            v.isFunction(e) ? (t = e, e = ["*"]) : e = e.split(" ");
            var n, r = 0,
                i = e.length;
            for (; r < i; r++) n = e[r], Vn[n] = Vn[n] || [], Vn[n].unshift(t)
        },
        prefilter: function (e, t) {
            t ? Xn.unshift(e) : Xn.push(e)
        }
    }), v.Tween = Yn, Yn.prototype = {
        constructor: Yn,
        init: function (e, t, n, r, i, s) {
            this.elem = e, this.prop = n, this.easing = i || "swing", this.options = t, this.start = this.now = this.cur(), this.end = r, this.unit = s || (v.cssNumber[n] ? "" : "px")
        },
        cur: function () {
            var e = Yn.propHooks[this.prop];
            return e && e.get ? e.get(this) : Yn.propHooks._default.get(this)
        },
        run: function (e) {
            var t, n = Yn.propHooks[this.prop];
            return this.options.duration ? this.pos = t = v.easing[this.easing](e, this.options.duration * e, 0, 1, this.options.duration) : this.pos = t = e, this.now = (this.end - this.start) * t + this.start, this.options.step && this.options.step.call(this.elem, this.now, this), n && n.set ? n.set(this) : Yn.propHooks._default.set(this), this
        }
    }, Yn.prototype.init.prototype = Yn.prototype, Yn.propHooks = {
        _default: {
            get: function (e) {
                var t;
                return e.elem[e.prop] == null || !! e.elem.style && e.elem.style[e.prop] != null ? (t = v.css(e.elem, e.prop, !1, ""), !t || t === "auto" ? 0 : t) : e.elem[e.prop]
            },
            set: function (e) {
                v.fx.step[e.prop] ? v.fx.step[e.prop](e) : e.elem.style && (e.elem.style[v.cssProps[e.prop]] != null || v.cssHooks[e.prop]) ? v.style(e.elem, e.prop, e.now + e.unit) : e.elem[e.prop] = e.now
            }
        }
    }, Yn.propHooks.scrollTop = Yn.propHooks.scrollLeft = {
        set: function (e) {
            e.elem.nodeType && e.elem.parentNode && (e.elem[e.prop] = e.now)
        }
    }, v.each(["toggle", "show", "hide"], function (e, t) {
        var n = v.fn[t];
        v.fn[t] = function (r, i, s) {
            return r == null || typeof r == "boolean" || !e && v.isFunction(r) && v.isFunction(i) ? n.apply(this, arguments) : this.animate(Zn(t, !0), r, i, s)
        }
    }), v.fn.extend({
        fadeTo: function (e, t, n, r) {
            return this.filter(Gt).css("opacity", 0).show().end().animate({
                opacity: t
            }, e, n, r)
        },
        animate: function (e, t, n, r) {
            var i = v.isEmptyObject(e),
                s = v.speed(t, n, r),
                o = function () {
                    var t = Kn(this, v.extend({}, e), s);
                    i && t.stop(!0)
                };
            return i || s.queue === !1 ? this.each(o) : this.queue(s.queue, o)
        },
        stop: function (e, n, r) {
            var i = function (e) {
                var t = e.stop;
                delete e.stop, t(r)
            };
            return typeof e != "string" && (r = n, n = e, e = t), n && e !== !1 && this.queue(e || "fx", []), this.each(function () {
                var t = !0,
                    n = e != null && e + "queueHooks",
                    s = v.timers,
                    o = v._data(this);
                if (n) o[n] && o[n].stop && i(o[n]);
                else
                    for (n in o) o[n] && o[n].stop && Wn.test(n) && i(o[n]);
                for (n = s.length; n--;) s[n].elem === this && (e == null || s[n].queue === e) && (s[n].anim.stop(r), t = !1, s.splice(n, 1));
                (t || !r) && v.dequeue(this, e)
            })
        }
    }), v.each({
        slideDown: Zn("show"),
        slideUp: Zn("hide"),
        slideToggle: Zn("toggle"),
        fadeIn: {
            opacity: "show"
        },
        fadeOut: {
            opacity: "hide"
        },
        fadeToggle: {
            opacity: "toggle"
        }
    }, function (e, t) {
        v.fn[e] = function (e, n, r) {
            return this.animate(t, e, n, r)
        }
    }), v.speed = function (e, t, n) {
        var r = e && typeof e == "object" ? v.extend({}, e) : {
            complete: n || !n && t || v.isFunction(e) && e,
            duration: e,
            easing: n && t || t && !v.isFunction(t) && t
        };
        r.duration = v.fx.off ? 0 : typeof r.duration == "number" ? r.duration : r.duration in v.fx.speeds ? v.fx.speeds[r.duration] : v.fx.speeds._default;
        if (r.queue == null || r.queue === !0) r.queue = "fx";
        return r.old = r.complete, r.complete = function () {
            v.isFunction(r.old) && r.old.call(this), r.queue && v.dequeue(this, r.queue)
        }, r
    }, v.easing = {
        linear: function (e) {
            return e
        },
        swing: function (e) {
            return .5 - Math.cos(e * Math.PI) / 2
        }
    }, v.timers = [], v.fx = Yn.prototype.init, v.fx.tick = function () {
        var e, t = v.timers,
            n = 0;
        for (; n < t.length; n++) e = t[n], !e() && t[n] === e && t.splice(n--, 1);
        t.length || v.fx.stop()
    }, v.fx.timer = function (e) {
        e() && v.timers.push(e) && !Rn && (Rn = setInterval(v.fx.tick, v.fx.interval))
    }, v.fx.interval = 13, v.fx.stop = function () {
        clearInterval(Rn), Rn = null
    }, v.fx.speeds = {
        slow: 600,
        fast: 200,
        _default: 400
    }, v.fx.step = {}, v.expr && v.expr.filters && (v.expr.filters.animated = function (e) {
        return v.grep(v.timers, function (t) {
            return e === t.elem
        }).length
    });
    var er = /^(?:body|html)$/i;
    v.fn.offset = function (e) {
        if (arguments.length) return e === t ? this : this.each(function (t) {
            v.offset.setOffset(this, e, t)
        });
        var n, r, i, s, o, u, a, f = {
                top: 0,
                left: 0
            }, l = this[0],
            c = l && l.ownerDocument;
        if (!c) return;
        return (r = c.body) === l ? v.offset.bodyOffset(l) : (n = c.documentElement, v.contains(n, l) ? (typeof l.getBoundingClientRect != "undefined" && (f = l.getBoundingClientRect()), i = tr(c), s = n.clientTop || r.clientTop || 0, o = n.clientLeft || r.clientLeft || 0, u = i.pageYOffset || n.scrollTop, a = i.pageXOffset || n.scrollLeft, {
            top: f.top + u - s,
            left: f.left + a - o
        }) : f)
    }, v.offset = {
        bodyOffset: function (e) {
            var t = e.offsetTop,
                n = e.offsetLeft;
            return v.support.doesNotIncludeMarginInBodyOffset && (t += parseFloat(v.css(e, "marginTop")) || 0, n += parseFloat(v.css(e, "marginLeft")) || 0), {
                top: t,
                left: n
            }
        },
        setOffset: function (e, t, n) {
            var r = v.css(e, "position");
            r === "static" && (e.style.position = "relative");
            var i = v(e),
                s = i.offset(),
                o = v.css(e, "top"),
                u = v.css(e, "left"),
                a = (r === "absolute" || r === "fixed") && v.inArray("auto", [o, u]) > -1,
                f = {}, l = {}, c, h;
            a ? (l = i.position(), c = l.top, h = l.left) : (c = parseFloat(o) || 0, h = parseFloat(u) || 0), v.isFunction(t) && (t = t.call(e, n, s)), t.top != null && (f.top = t.top - s.top + c), t.left != null && (f.left = t.left - s.left + h), "using" in t ? t.using.call(e, f) : i.css(f)
        }
    }, v.fn.extend({
        position: function () {
            if (!this[0]) return;
            var e = this[0],
                t = this.offsetParent(),
                n = this.offset(),
                r = er.test(t[0].nodeName) ? {
                    top: 0,
                    left: 0
                } : t.offset();
            return n.top -= parseFloat(v.css(e, "marginTop")) || 0, n.left -= parseFloat(v.css(e, "marginLeft")) || 0, r.top += parseFloat(v.css(t[0], "borderTopWidth")) || 0, r.left += parseFloat(v.css(t[0], "borderLeftWidth")) || 0, {
                top: n.top - r.top,
                left: n.left - r.left
            }
        },
        offsetParent: function () {
            return this.map(function () {
                var e = this.offsetParent || i.body;
                while (e && !er.test(e.nodeName) && v.css(e, "position") === "static") e = e.offsetParent;
                return e || i.body
            })
        }
    }), v.each({
        scrollLeft: "pageXOffset",
        scrollTop: "pageYOffset"
    }, function (e, n) {
        var r = /Y/.test(n);
        v.fn[e] = function (i) {
            return v.access(this, function (e, i, s) {
                var o = tr(e);
                if (s === t) return o ? n in o ? o[n] : o.document.documentElement[i] : e[i];
                o ? o.scrollTo(r ? v(o).scrollLeft() : s, r ? s : v(o).scrollTop()) : e[i] = s
            }, e, i, arguments.length, null)
        }
    }), v.each({
        Height: "height",
        Width: "width"
    }, function (e, n) {
        v.each({
            padding: "inner" + e,
            content: n,
            "": "outer" + e
        }, function (r, i) {
            v.fn[i] = function (i, s) {
                var o = arguments.length && (r || typeof i != "boolean"),
                    u = r || (i === !0 || s === !0 ? "margin" : "border");
                return v.access(this, function (n, r, i) {
                    var s;
                    return v.isWindow(n) ? n.document.documentElement["client" + e] : n.nodeType === 9 ? (s = n.documentElement, Math.max(n.body["scroll" + e], s["scroll" + e], n.body["offset" + e], s["offset" + e], s["client" + e])) : i === t ? v.css(n, r, i, u) : v.style(n, r, i, u)
                }, n, o ? i : t, o, null)
            }
        })
    }), e.jQuery = e.$ = v, typeof define == "function" && define.amd && define.amd.jQuery && define("jquery", [], function () {
        return v
    })
})(window),
function (e, t) {
    function i(t, n) {
        var r, i, o, u = t.nodeName.toLowerCase();
        return "area" === u ? (r = t.parentNode, i = r.name, !t.href || !i || r.nodeName.toLowerCase() !== "map" ? !1 : (o = e("img[usemap=#" + i + "]")[0], !! o && s(o))) : (/input|select|textarea|button|object/.test(u) ? !t.disabled : "a" === u ? t.href || n : n) && s(t)
    }

    function s(t) {
        return e.expr.filters.visible(t) && !e(t).parents().addBack().filter(function () {
            return e.css(this, "visibility") === "hidden"
        }).length
    }
    var n = 0,
        r = /^ui-id-\d+$/;
    e.ui = e.ui || {}, e.extend(e.ui, {
        version: "1.10.2",
        keyCode: {
            BACKSPACE: 8,
            COMMA: 188,
            DELETE: 46,
            DOWN: 40,
            END: 35,
            ENTER: 13,
            ESCAPE: 27,
            HOME: 36,
            LEFT: 37,
            NUMPAD_ADD: 107,
            NUMPAD_DECIMAL: 110,
            NUMPAD_DIVIDE: 111,
            NUMPAD_ENTER: 108,
            NUMPAD_MULTIPLY: 106,
            NUMPAD_SUBTRACT: 109,
            PAGE_DOWN: 34,
            PAGE_UP: 33,
            PERIOD: 190,
            RIGHT: 39,
            SPACE: 32,
            TAB: 9,
            UP: 38
        }
    }), e.fn.extend({
        focus: function (t) {
            return function (n, r) {
                return typeof n == "number" ? this.each(function () {
                    var t = this;
                    setTimeout(function () {
                        e(t).focus(), r && r.call(t)
                    }, n)
                }) : t.apply(this, arguments)
            }
        }(e.fn.focus),
        scrollParent: function () {
            var t;
            return e.ui.ie && /(static|relative)/.test(this.css("position")) || /absolute/.test(this.css("position")) ? t = this.parents().filter(function () {
                return /(relative|absolute|fixed)/.test(e.css(this, "position")) && /(auto|scroll)/.test(e.css(this, "overflow") + e.css(this, "overflow-y") + e.css(this, "overflow-x"))
            }).eq(0) : t = this.parents().filter(function () {
                return /(auto|scroll)/.test(e.css(this, "overflow") + e.css(this, "overflow-y") + e.css(this, "overflow-x"))
            }).eq(0), /fixed/.test(this.css("position")) || !t.length ? e(document) : t
        },
        zIndex: function (n) {
            if (n !== t) return this.css("zIndex", n);
            if (this.length) {
                var r = e(this[0]),
                    i, s;
                while (r.length && r[0] !== document) {
                    i = r.css("position");
                    if (i === "absolute" || i === "relative" || i === "fixed") {
                        s = parseInt(r.css("zIndex"), 10);
                        if (!isNaN(s) && s !== 0) return s
                    }
                    r = r.parent()
                }
            }
            return 0
        },
        uniqueId: function () {
            return this.each(function () {
                this.id || (this.id = "ui-id-" + ++n)
            })
        },
        removeUniqueId: function () {
            return this.each(function () {
                r.test(this.id) && e(this).removeAttr("id")
            })
        }
    }), e.extend(e.expr[":"], {
        data: e.expr.createPseudo ? e.expr.createPseudo(function (t) {
            return function (n) {
                return !!e.data(n, t)
            }
        }) : function (t, n, r) {
            return !!e.data(t, r[3])
        },
        focusable: function (t) {
            return i(t, !isNaN(e.attr(t, "tabindex")))
        },
        tabbable: function (t) {
            var n = e.attr(t, "tabindex"),
                r = isNaN(n);
            return (r || n >= 0) && i(t, !r)
        }
    }), e("<a>").outerWidth(1).jquery || e.each(["Width", "Height"], function (n, r) {
        function u(t, n, r, s) {
            return e.each(i, function () {
                n -= parseFloat(e.css(t, "padding" + this)) || 0, r && (n -= parseFloat(e.css(t, "border" + this + "Width")) || 0), s && (n -= parseFloat(e.css(t, "margin" + this)) || 0)
            }), n
        }
        var i = r === "Width" ? ["Left", "Right"] : ["Top", "Bottom"],
            s = r.toLowerCase(),
            o = {
                innerWidth: e.fn.innerWidth,
                innerHeight: e.fn.innerHeight,
                outerWidth: e.fn.outerWidth,
                outerHeight: e.fn.outerHeight
            };
        e.fn["inner" + r] = function (n) {
            return n === t ? o["inner" + r].call(this) : this.each(function () {
                e(this).css(s, u(this, n) + "px")
            })
        }, e.fn["outer" + r] = function (t, n) {
            return typeof t != "number" ? o["outer" + r].call(this, t) : this.each(function () {
                e(this).css(s, u(this, t, !0, n) + "px")
            })
        }
    }), e.fn.addBack || (e.fn.addBack = function (e) {
        return this.add(e == null ? this.prevObject : this.prevObject.filter(e))
    }), e("<a>").data("a-b", "a").removeData("a-b").data("a-b") && (e.fn.removeData = function (t) {
        return function (n) {
            return arguments.length ? t.call(this, e.camelCase(n)) : t.call(this)
        }
    }(e.fn.removeData)), e.ui.ie = !! /msie [\w.]+/.exec(navigator.userAgent.toLowerCase()), e.support.selectstart = "onselectstart" in
        document.createElement("div"), e.fn.extend({
            disableSelection: function () {
                return this.bind((e.support.selectstart ? "selectstart" : "mousedown") + ".ui-disableSelection", function (e) {
                    e.preventDefault()
                })
            },
            enableSelection: function () {
                return this.unbind(".ui-disableSelection")
            }
        }), e.extend(e.ui, {
            plugin: {
                add: function (t, n, r) {
                    var i, s = e.ui[t].prototype;
                    for (i in r) s.plugins[i] = s.plugins[i] || [], s.plugins[i].push([n, r[i]])
                },
                call: function (e, t, n) {
                    var r, i = e.plugins[t];
                    if (!i || !e.element[0].parentNode || e.element[0].parentNode.nodeType === 11) return;
                    for (r = 0; r < i.length; r++) e.options[i[r][0]] && i[r][1].apply(e.element, n)
                }
            },
            hasScroll: function (t, n) {
                if (e(t).css("overflow") === "hidden") return !1;
                var r = n && n === "left" ? "scrollLeft" : "scrollTop",
                    i = !1;
                return t[r] > 0 ? !0 : (t[r] = 1, i = t[r] > 0, t[r] = 0, i)
            }
        })
}(jQuery),
function (e, t) {
    var n = 0,
        r = Array.prototype.slice,
        i = e.cleanData;
    e.cleanData = function (t) {
        for (var n = 0, r;
            (r = t[n]) != null; n++) try {
            e(r).triggerHandler("remove")
        } catch (s) {}
        i(t)
    }, e.widget = function (t, n, r) {
        var i, s, o, u, a = {}, f = t.split(".")[0];
        t = t.split(".")[1], i = f + "-" + t, r || (r = n, n = e.Widget), e.expr[":"][i.toLowerCase()] = function (t) {
            return !!e.data(t, i)
        }, e[f] = e[f] || {}, s = e[f][t], o = e[f][t] = function (e, t) {
            if (!this._createWidget) return new o(e, t);
            arguments.length && this._createWidget(e, t)
        }, e.extend(o, s, {
            version: r.version,
            _proto: e.extend({}, r),
            _childConstructors: []
        }), u = new n, u.options = e.widget.extend({}, u.options), e.each(r, function (t, r) {
            if (!e.isFunction(r)) {
                a[t] = r;
                return
            }
            a[t] = function () {
                var e = function () {
                    return n.prototype[t].apply(this, arguments)
                }, i = function (e) {
                        return n.prototype[t].apply(this, e)
                    };
                return function () {
                    var t = this._super,
                        n = this._superApply,
                        s;
                    return this._super = e, this._superApply = i, s = r.apply(this, arguments), this._super = t, this._superApply = n, s
                }
            }()
        }), o.prototype = e.widget.extend(u, {
            widgetEventPrefix: s ? u.widgetEventPrefix : t
        }, a, {
            constructor: o,
            namespace: f,
            widgetName: t,
            widgetFullName: i
        }), s ? (e.each(s._childConstructors, function (t, n) {
            var r = n.prototype;
            e.widget(r.namespace + "." + r.widgetName, o, n._proto)
        }), delete s._childConstructors) : n._childConstructors.push(o), e.widget.bridge(t, o)
    }, e.widget.extend = function (n) {
        var i = r.call(arguments, 1),
            s = 0,
            o = i.length,
            u, a;
        for (; s < o; s++)
            for (u in i[s]) a = i[s][u], i[s].hasOwnProperty(u) && a !== t && (e.isPlainObject(a) ? n[u] = e.isPlainObject(n[u]) ? e.widget.extend({}, n[u], a) : e.widget.extend({}, a) : n[u] = a);
        return n
    }, e.widget.bridge = function (n, i) {
        var s = i.prototype.widgetFullName || n;
        e.fn[n] = function (o) {
            var u = typeof o == "string",
                a = r.call(arguments, 1),
                f = this;
            return o = !u && a.length ? e.widget.extend.apply(null, [o].concat(a)) : o, u ? this.each(function () {
                var r, i = e.data(this, s);
                if (!i) return e.error("cannot call methods on " + n + " prior to initialization; " + "attempted to call method '" + o + "'");
                if (!e.isFunction(i[o]) || o.charAt(0) === "_") return e.error("no such method '" + o + "' for " + n + " widget instance");
                r = i[o].apply(i, a);
                if (r !== i && r !== t) return f = r && r.jquery ? f.pushStack(r.get()) : r, !1
            }) : this.each(function () {
                var t = e.data(this, s);
                t ? t.option(o || {})._init() : e.data(this, s, new i(o, this))
            }), f
        }
    }, e.Widget = function () {}, e.Widget._childConstructors = [], e.Widget.prototype = {
        widgetName: "widget",
        widgetEventPrefix: "",
        defaultElement: "<div>",
        options: {
            disabled: !1,
            create: null
        },
        _createWidget: function (t, r) {
            r = e(r || this.defaultElement || this)[0], this.element = e(r), this.uuid = n++, this.eventNamespace = "." + this.widgetName + this.uuid, this.options = e.widget.extend({}, this.options, this._getCreateOptions(), t), this.bindings = e(), this.hoverable = e(), this.focusable = e(), r !== this && (e.data(r, this.widgetFullName, this), this._on(!0, this.element, {
                remove: function (e) {
                    e.target === r && this.destroy()
                }
            }), this.document = e(r.style ? r.ownerDocument : r.document || r), this.window = e(this.document[0].defaultView || this.document[0].parentWindow)), this._create(), this._trigger("create", null, this._getCreateEventData()), this._init()
        },
        _getCreateOptions: e.noop,
        _getCreateEventData: e.noop,
        _create: e.noop,
        _init: e.noop,
        destroy: function () {
            this._destroy(), this.element.unbind(this.eventNamespace).removeData(this.widgetName).removeData(this.widgetFullName).removeData(e.camelCase(this.widgetFullName)), this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName + "-disabled " + "ui-state-disabled"), this.bindings.unbind(this.eventNamespace), this.hoverable.removeClass("ui-state-hover"), this.focusable.removeClass("ui-state-focus")
        },
        _destroy: e.noop,
        widget: function () {
            return this.element
        },
        option: function (n, r) {
            var i = n,
                s, o, u;
            if (arguments.length === 0) return e.widget.extend({}, this.options);
            if (typeof n == "string") {
                i = {}, s = n.split("."), n = s.shift();
                if (s.length) {
                    o = i[n] = e.widget.extend({}, this.options[n]);
                    for (u = 0; u < s.length - 1; u++) o[s[u]] = o[s[u]] || {}, o = o[s[u]];
                    n = s.pop();
                    if (r === t) return o[n] === t ? null : o[n];
                    o[n] = r
                } else {
                    if (r === t) return this.options[n] === t ? null : this.options[n];
                    i[n] = r
                }
            }
            return this._setOptions(i), this
        },
        _setOptions: function (e) {
            var t;
            for (t in e) this._setOption(t, e[t]);
            return this
        },
        _setOption: function (e, t) {
            return this.options[e] = t, e === "disabled" && (this.widget().toggleClass(this.widgetFullName + "-disabled ui-state-disabled", !! t).attr("aria-disabled", t), this.hoverable.removeClass("ui-state-hover"), this.focusable.removeClass("ui-state-focus")), this
        },
        enable: function () {
            return this._setOption("disabled", !1)
        },
        disable: function () {
            return this._setOption("disabled", !0)
        },
        _on: function (t, n, r) {
            var i, s = this;
            typeof t != "boolean" && (r = n, n = t, t = !1), r ? (n = i = e(n), this.bindings = this.bindings.add(n)) : (r = n, n = this.element, i = this.widget()), e.each(r, function (r, o) {
                function u() {
                    if (!t && (s.options.disabled === !0 || e(this).hasClass("ui-state-disabled"))) return;
                    return (typeof o == "string" ? s[o] : o).apply(s, arguments)
                }
                typeof o != "string" && (u.guid = o.guid = o.guid || u.guid || e.guid++);
                var a = r.match(/^(\w+)\s*(.*)$/),
                    f = a[1] + s.eventNamespace,
                    l = a[2];
                l ? i.delegate(l, f, u) : n.bind(f, u)
            })
        },
        _off: function (e, t) {
            t = (t || "").split(" ").join(this.eventNamespace + " ") + this.eventNamespace, e.unbind(t).undelegate(t)
        },
        _delay: function (e, t) {
            function n() {
                return (typeof e == "string" ? r[e] : e).apply(r, arguments)
            }
            var r = this;
            return setTimeout(n, t || 0)
        },
        _hoverable: function (t) {
            this.hoverable = this.hoverable.add(t), this._on(t, {
                mouseenter: function (t) {
                    e(t.currentTarget).addClass("ui-state-hover")
                },
                mouseleave: function (t) {
                    e(t.currentTarget).removeClass("ui-state-hover")
                }
            })
        },
        _focusable: function (t) {
            this.focusable = this.focusable.add(t), this._on(t, {
                focusin: function (t) {
                    e(t.currentTarget).addClass("ui-state-focus")
                },
                focusout: function (t) {
                    e(t.currentTarget).removeClass("ui-state-focus")
                }
            })
        },
        _trigger: function (t, n, r) {
            var i, s, o = this.options[t];
            r = r || {}, n = e.Event(n), n.type = (t === this.widgetEventPrefix ? t : this.widgetEventPrefix + t).toLowerCase(), n.target = this.element[0], s = n.originalEvent;
            if (s)
                for (i in s) i in n || (n[i] = s[i]);
            return this.element.trigger(n, r), !(e.isFunction(o) && o.apply(this.element[0], [n].concat(r)) === !1 || n.isDefaultPrevented())
        }
    }, e.each({
        show: "fadeIn",
        hide: "fadeOut"
    }, function (t, n) {
        e.Widget.prototype["_" + t] = function (r, i, s) {
            typeof i == "string" && (i = {
                effect: i
            });
            var o, u = i ? i === !0 || typeof i == "number" ? n : i.effect || n : t;
            i = i || {}, typeof i == "number" && (i = {
                duration: i
            }), o = !e.isEmptyObject(i), i.complete = s, i.delay && r.delay(i.delay), o && e.effects && e.effects.effect[u] ? r[t](i) : u !== t && r[u] ? r[u](i.duration, i.easing, s) : r.queue(function (n) {
                e(this)[t](), s && s.call(r[0]), n()
            })
        }
    })
}(jQuery),
function (e, t) {
    var n = !1;
    e(document).mouseup(function () {
        n = !1
    }), e.widget("ui.mouse", {
        version: "1.10.2",
        options: {
            cancel: "input,textarea,button,select,option",
            distance: 1,
            delay: 0
        },
        _mouseInit: function () {
            var t = this;
            this.element.bind("mousedown." + this.widgetName, function (e) {
                return t._mouseDown(e)
            }).bind("click." + this.widgetName, function (n) {
                if (!0 === e.data(n.target, t.widgetName + ".preventClickEvent")) return e.removeData(n.target, t.widgetName + ".preventClickEvent"), n.stopImmediatePropagation(), !1
            }), this.started = !1
        },
        _mouseDestroy: function () {
            this.element.unbind("." + this.widgetName), this._mouseMoveDelegate && e(document).unbind("mousemove." + this.widgetName, this._mouseMoveDelegate).unbind("mouseup." + this.widgetName, this._mouseUpDelegate)
        },
        _mouseDown: function (t) {
            if (n) return;
            this._mouseStarted && this._mouseUp(t), this._mouseDownEvent = t;
            var r = this,
                i = t.which === 1,
                s = typeof this.options.cancel == "string" && t.target.nodeName ? e(t.target).closest(this.options.cancel).length : !1;
            if (!i || s || !this._mouseCapture(t)) return !0;
            this.mouseDelayMet = !this.options.delay, this.mouseDelayMet || (this._mouseDelayTimer = setTimeout(function () {
                r.mouseDelayMet = !0
            }, this.options.delay));
            if (this._mouseDistanceMet(t) && this._mouseDelayMet(t)) {
                this._mouseStarted = this._mouseStart(t) !== !1;
                if (!this._mouseStarted) return t.preventDefault(), !0
            }
            return !0 === e.data(t.target, this.widgetName + ".preventClickEvent") && e.removeData(t.target, this.widgetName + ".preventClickEvent"), this._mouseMoveDelegate = function (e) {
                return r._mouseMove(e)
            }, this._mouseUpDelegate = function (e) {
                return r._mouseUp(e)
            }, e(document).bind("mousemove." + this.widgetName, this._mouseMoveDelegate).bind("mouseup." + this.widgetName, this._mouseUpDelegate), t.preventDefault(), n = !0, !0
        },
        _mouseMove: function (t) {
            return e.ui.ie && (!document.documentMode || document.documentMode < 9) && !t.button ? this._mouseUp(t) : this._mouseStarted ? (this._mouseDrag(t), t.preventDefault()) : (this._mouseDistanceMet(t) && this._mouseDelayMet(t) && (this._mouseStarted = this._mouseStart(this._mouseDownEvent, t) !== !1, this._mouseStarted ? this._mouseDrag(t) : this._mouseUp(t)), !this._mouseStarted)
        },
        _mouseUp: function (t) {
            return e(document).unbind("mousemove." + this.widgetName, this._mouseMoveDelegate).unbind("mouseup." + this.widgetName, this._mouseUpDelegate), this._mouseStarted && (this._mouseStarted = !1, t.target === this._mouseDownEvent.target && e.data(t.target, this.widgetName + ".preventClickEvent", !0), this._mouseStop(t)), !1
        },
        _mouseDistanceMet: function (e) {
            return Math.max(Math.abs(this._mouseDownEvent.pageX - e.pageX), Math.abs(this._mouseDownEvent.pageY - e.pageY)) >= this.options.distance
        },
        _mouseDelayMet: function () {
            return this.mouseDelayMet
        },
        _mouseStart: function () {},
        _mouseDrag: function () {},
        _mouseStop: function () {},
        _mouseCapture: function () {
            return !0
        }
    })
}(jQuery),
function (e, t) {
    function h(e, t, n) {
        return [parseFloat(e[0]) * (l.test(e[0]) ? t / 100 : 1), parseFloat(e[1]) * (l.test(e[1]) ? n / 100 : 1)]
    }

    function p(t, n) {
        return parseInt(e.css(t, n), 10) || 0
    }

    function d(t) {
        var n = t[0];
        return n.nodeType === 9 ? {
            width: t.width(),
            height: t.height(),
            offset: {
                top: 0,
                left: 0
            }
        } : e.isWindow(n) ? {
            width: t.width(),
            height: t.height(),
            offset: {
                top: t.scrollTop(),
                left: t.scrollLeft()
            }
        } : n.preventDefault ? {
            width: 0,
            height: 0,
            offset: {
                top: n.pageY,
                left: n.pageX
            }
        } : {
            width: t.outerWidth(),
            height: t.outerHeight(),
            offset: t.offset()
        }
    }
    e.ui = e.ui || {};
    var n, r = Math.max,
        i = Math.abs,
        s = Math.round,
        o = /left|center|right/,
        u = /top|center|bottom/,
        a = /[\+\-]\d+(\.[\d]+)?%?/,
        f = /^\w+/,
        l = /%$/,
        c = e.fn.position;
    e.position = {
        scrollbarWidth: function () {
            if (n !== t) return n;
            var r, i, s = e("<div style='display:block;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>"),
                o = s.children()[0];
            return e("body").append(s), r = o.offsetWidth, s.css("overflow", "scroll"), i = o.offsetWidth, r === i && (i = s[0].clientWidth), s.remove(), n = r - i
        },
        getScrollInfo: function (t) {
            var n = t.isWindow ? "" : t.element.css("overflow-x"),
                r = t.isWindow ? "" : t.element.css("overflow-y"),
                i = n === "scroll" || n === "auto" && t.width < t.element[0].scrollWidth,
                s = r === "scroll" || r === "auto" && t.height < t.element[0].scrollHeight;
            return {
                width: s ? e.position.scrollbarWidth() : 0,
                height: i ? e.position.scrollbarWidth() : 0
            }
        },
        getWithinInfo: function (t) {
            var n = e(t || window),
                r = e.isWindow(n[0]);
            return {
                element: n,
                isWindow: r,
                offset: n.offset() || {
                    left: 0,
                    top: 0
                },
                scrollLeft: n.scrollLeft(),
                scrollTop: n.scrollTop(),
                width: r ? n.width() : n.outerWidth(),
                height: r ? n.height() : n.outerHeight()
            }
        }
    }, e.fn.position = function (t) {
        if (!t || !t.of) return c.apply(this, arguments);
        t = e.extend({}, t);
        var n, l, v, m, g, y, b = e(t.of),
            w = e.position.getWithinInfo(t.within),
            E = e.position.getScrollInfo(w),
            S = (t.collision || "flip").split(" "),
            x = {};
        return y = d(b), b[0].preventDefault && (t.at = "left top"), l = y.width, v = y.height, m = y.offset, g = e.extend({}, m), e.each(["my", "at"], function () {
            var e = (t[this] || "").split(" "),
                n, r;
            e.length === 1 && (e = o.test(e[0]) ? e.concat(["center"]) : u.test(e[0]) ? ["center"].concat(e) : ["center", "center"]), e[0] = o.test(e[0]) ? e[0] : "center", e[1] = u.test(e[1]) ? e[1] : "center", n = a.exec(e[0]), r = a.exec(e[1]), x[this] = [n ? n[0] : 0, r ? r[0] : 0], t[this] = [f.exec(e[0])[0], f.exec(e[1])[0]]
        }), S.length === 1 && (S[1] = S[0]), t.at[0] === "right" ? g.left += l : t.at[0] === "center" && (g.left += l / 2), t.at[1] === "bottom" ? g.top += v : t.at[1] === "center" && (g.top += v / 2), n = h(x.at, l, v), g.left += n[0], g.top += n[1], this.each(function () {
            var o, u, a = e(this),
                f = a.outerWidth(),
                c = a.outerHeight(),
                d = p(this, "marginLeft"),
                y = p(this, "marginTop"),
                T = f + d + p(this, "marginRight") + E.width,
                N = c + y + p(this, "marginBottom") + E.height,
                C = e.extend({}, g),
                k = h(x.my, a.outerWidth(), a.outerHeight());
            t.my[0] === "right" ? C.left -= f : t.my[0] === "center" && (C.left -= f / 2), t.my[1] === "bottom" ? C.top -= c : t.my[1] === "center" && (C.top -= c / 2), C.left += k[0], C.top += k[1], e.support.offsetFractions || (C.left = s(C.left), C.top = s(C.top)), o = {
                marginLeft: d,
                marginTop: y
            }, e.each(["left", "top"], function (r, i) {
                e.ui.position[S[r]] && e.ui.position[S[r]][i](C, {
                    targetWidth: l,
                    targetHeight: v,
                    elemWidth: f,
                    elemHeight: c,
                    collisionPosition: o,
                    collisionWidth: T,
                    collisionHeight: N,
                    offset: [n[0] + k[0], n[1] + k[1]],
                    my: t.my,
                    at: t.at,
                    within: w,
                    elem: a
                })
            }), t.using && (u = function (e) {
                var n = m.left - C.left,
                    s = n + l - f,
                    o = m.top - C.top,
                    u = o + v - c,
                    h = {
                        target: {
                            element: b,
                            left: m.left,
                            top: m.top,
                            width: l,
                            height: v
                        },
                        element: {
                            element: a,
                            left: C.left,
                            top: C.top,
                            width: f,
                            height: c
                        },
                        horizontal: s < 0 ? "left" : n > 0 ? "right" : "center",
                        vertical: u < 0 ? "top" : o > 0 ? "bottom" : "middle"
                    };
                l < f && i(n + s) < l && (h.horizontal = "center"), v < c && i(o + u) < v && (h.vertical = "middle"), r(i(n), i(s)) > r(i(o), i(u)) ? h.important = "horizontal" : h.important = "vertical", t.using.call(this, e, h)
            }), a.offset(e.extend(C, {
                using: u
            }))
        })
    }, e.ui.position = {
        fit: {
            left: function (e, t) {
                var n = t.within,
                    i = n.isWindow ? n.scrollLeft : n.offset.left,
                    s = n.width,
                    o = e.left - t.collisionPosition.marginLeft,
                    u = i - o,
                    a = o + t.collisionWidth - s - i,
                    f;
                t.collisionWidth > s ? u > 0 && a <= 0 ? (f = e.left + u + t.collisionWidth - s - i, e.left += u - f) : a > 0 && u <= 0 ? e.left = i : u > a ? e.left = i + s - t.collisionWidth : e.left = i : u > 0 ? e.left += u : a > 0 ? e.left -= a : e.left = r(e.left - o, e.left)
            },
            top: function (e, t) {
                var n = t.within,
                    i = n.isWindow ? n.scrollTop : n.offset.top,
                    s = t.within.height,
                    o = e.top - t.collisionPosition.marginTop,
                    u = i - o,
                    a = o + t.collisionHeight - s - i,
                    f;
                t.collisionHeight > s ? u > 0 && a <= 0 ? (f = e.top + u + t.collisionHeight - s - i, e.top += u - f) : a > 0 && u <= 0 ? e.top = i : u > a ? e.top = i + s - t.collisionHeight : e.top = i : u > 0 ? e.top += u : a > 0 ? e.top -= a : e.top = r(e.top - o, e.top)
            }
        },
        flip: {
            left: function (e, t) {
                var n = t.within,
                    r = n.offset.left + n.scrollLeft,
                    s = n.width,
                    o = n.isWindow ? n.scrollLeft : n.offset.left,
                    u = e.left - t.collisionPosition.marginLeft,
                    a = u - o,
                    f = u + t.collisionWidth - s - o,
                    l = t.my[0] === "left" ? -t.elemWidth : t.my[0] === "right" ? t.elemWidth : 0,
                    c = t.at[0] === "left" ? t.targetWidth : t.at[0] === "right" ? -t.targetWidth : 0,
                    h = -2 * t.offset[0],
                    p, d;
                if (a < 0) {
                    p = e.left + l + c + h + t.collisionWidth - s - r;
                    if (p < 0 || p < i(a)) e.left += l + c + h
                } else if (f > 0) {
                    d = e.left - t.collisionPosition.marginLeft + l + c + h - o;
                    if (d > 0 || i(d) < f) e.left += l + c + h
                }
            },
            top: function (e, t) {
                var n = t.within,
                    r = n.offset.top + n.scrollTop,
                    s = n.height,
                    o = n.isWindow ? n.scrollTop : n.offset.top,
                    u = e.top - t.collisionPosition.marginTop,
                    a = u - o,
                    f = u + t.collisionHeight - s - o,
                    l = t.my[1] === "top",
                    c = l ? -t.elemHeight : t.my[1] === "bottom" ? t.elemHeight : 0,
                    h = t.at[1] === "top" ? t.targetHeight : t.at[1] === "bottom" ? -t.targetHeight : 0,
                    p = -2 * t.offset[1],
                    d, v;
                a < 0 ? (v = e.top + c + h + p + t.collisionHeight - s - r, e.top + c + h + p > a && (v < 0 || v < i(a)) && (e.top += c + h + p)) : f > 0 && (d = e.top - t.collisionPosition.marginTop + c + h + p - o, e.top + c + h + p > f && (d > 0 || i(d) < f) && (e.top += c + h + p))
            }
        },
        flipfit: {
            left: function () {
                e.ui.position.flip.left.apply(this, arguments), e.ui.position.fit.left.apply(this, arguments)
            },
            top: function () {
                e.ui.position.flip.top.apply(this, arguments), e.ui.position.fit.top.apply(this, arguments)
            }
        }
    },
    function () {
        var t, n, r, i, s, o = document.getElementsByTagName("body")[0],
            u = document.createElement("div");
        t = document.createElement(o ? "div" : "body"), r = {
            visibility: "hidden",
            width: 0,
            height: 0,
            border: 0,
            margin: 0,
            background: "none"
        }, o && e.extend(r, {
            position: "absolute",
            left: "-1000px",
            top: "-1000px"
        });
        for (s in r) t.style[s] = r[s];
        t.appendChild(u), n = o || document.documentElement, n.insertBefore(t, n.firstChild), u.style.cssText = "position: absolute; left: 10.7432222px;", i = e(u).offset().left, e.support.offsetFractions = i > 10 && i < 11, t.innerHTML = "", n.removeChild(t)
    }()
}(jQuery),
function (e, t) {
    e.widget("ui.draggable", e.ui.mouse, {
        version: "1.10.2",
        widgetEventPrefix: "drag",
        options: {
            addClasses: !0,
            appendTo: "parent",
            axis: !1,
            connectToSortable: !1,
            containment: !1,
            cursor: "auto",
            cursorAt: !1,
            grid: !1,
            handle: !1,
            helper: "original",
            iframeFix: !1,
            opacity: !1,
            refreshPositions: !1,
            revert: !1,
            revertDuration: 500,
            scope: "default",
            scroll: !0,
            scrollSensitivity: 20,
            scrollSpeed: 20,
            snap: !1,
            snapMode: "both",
            snapTolerance: 20,
            stack: !1,
            zIndex: !1,
            drag: null,
            start: null,
            stop: null
        },
        _create: function () {
            this.options.helper === "original" && !/^(?:r|a|f)/.test(this.element.css("position")) && (this.element[0].style.position = "relative"), this.options.addClasses && this.element.addClass("ui-draggable"), this.options.disabled && this.element.addClass("ui-draggable-disabled"), this._mouseInit()
        },
        _destroy: function () {
            this.element.removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"), this._mouseDestroy()
        },
        _mouseCapture: function (t) {
            var n = this.options;
            return this.helper || n.disabled || e(t.target).closest(".ui-resizable-handle").length > 0 ? !1 : (this.handle = this._getHandle(t), this.handle ? (e(n.iframeFix === !0 ? "iframe" : n.iframeFix).each(function () {
                e("<div class='ui-draggable-iframeFix' style='background: #fff;'></div>").css({
                    width: this.offsetWidth + "px",
                    height: this.offsetHeight + "px",
                    position: "absolute",
                    opacity: "0.001",
                    zIndex: 1e3
                }).css(e(this).offset()).appendTo("body")
            }), !0) : !1)
        },
        _mouseStart: function (t) {
            var n = this.options;
            return this.helper = this._createHelper(t), this.helper.addClass("ui-draggable-dragging"), this._cacheHelperProportions(), e.ui.ddmanager && (e.ui.ddmanager.current = this), this._cacheMargins(), this.cssPosition = this.helper.css("position"), this.scrollParent = this.helper.scrollParent(), this.offset = this.positionAbs = this.element.offset(), this.offset = {
                top: this.offset.top - this.margins.top,
                left: this.offset.left - this.margins.left
            }, e.extend(this.offset, {
                click: {
                    left: t.pageX - this.offset.left,
                    top: t.pageY - this.offset.top
                },
                parent: this._getParentOffset(),
                relative: this._getRelativeOffset()
            }), this.originalPosition = this.position = this._generatePosition(t), this.originalPageX = t.pageX, this.originalPageY = t.pageY, n.cursorAt && this._adjustOffsetFromHelper(n.cursorAt), n.containment && this._setContainment(), this._trigger("start", t) === !1 ? (this._clear(), !1) : (this._cacheHelperProportions(), e.ui.ddmanager && !n.dropBehaviour && e.ui.ddmanager.prepareOffsets(this, t), this._mouseDrag(t, !0), e.ui.ddmanager && e.ui.ddmanager.dragStart(this, t), !0)
        },
        _mouseDrag: function (t, n) {
            this.position = this._generatePosition(t), this.positionAbs = this._convertPositionTo("absolute");
            if (!n) {
                var r = this._uiHash();
                if (this._trigger("drag", t, r) === !1) return this._mouseUp({}), !1;
                this.position = r.position
            }
            if (!this.options.axis || this.options.axis !== "y") this.helper[0].style.left = this.position.left + "px";
            if (!this.options.axis || this.options.axis !== "x") this.helper[0].style.top = this.position.top + "px";
            return e.ui.ddmanager && e.ui.ddmanager.drag(this, t), !1
        },
        _mouseStop: function (t) {
            var n, r = this,
                i = !1,
                s = !1;
            e.ui.ddmanager && !this.options.dropBehaviour && (s = e.ui.ddmanager.drop(this, t)), this.dropped && (s = this.dropped, this.dropped = !1), n = this.element[0];
            while (n && (n = n.parentNode)) n === document && (i = !0);
            return !i && this.options.helper === "original" ? !1 : (this.options.revert === "invalid" && !s || this.options.revert === "valid" && s || this.options.revert === !0 || e.isFunction(this.options.revert) && this.options.revert.call(this.element, s) ? e(this.helper).animate(this.originalPosition, parseInt(this.options.revertDuration, 10), function () {
                r._trigger("stop", t) !== !1 && r._clear()
            }) : this._trigger("stop", t) !== !1 && this._clear(), !1)
        },
        _mouseUp: function (t) {
            return e("div.ui-draggable-iframeFix").each(function () {
                this.parentNode.removeChild(this)
            }), e.ui.ddmanager && e.ui.ddmanager.dragStop(this, t), e.ui.mouse.prototype._mouseUp.call(this, t)
        },
        cancel: function () {
            return this.helper.is(".ui-draggable-dragging") ? this._mouseUp({}) : this._clear(), this
        },
        _getHandle: function (t) {
            return this.options.handle ? !! e(t.target).closest(this.element.find(this.options.handle)).length : !0
        },
        _createHelper: function (t) {
            var n = this.options,
                r = e.isFunction(n.helper) ? e(n.helper.apply(this.element[0], [t])) : n.helper === "clone" ? this.element.clone().removeAttr("id") : this.element;
            return r.parents("body").length || r.appendTo(n.appendTo === "parent" ? this.element[0].parentNode : n.appendTo), r[0] !== this.element[0] && !/(fixed|absolute)/.test(r.css("position")) && r.css("position", "absolute"), r
        },
        _adjustOffsetFromHelper: function (t) {
            typeof t == "string" && (t = t.split(" ")), e.isArray(t) && (t = {
                left: +t[0],
                top: +t[1] || 0
            }), "left" in t && (this.offset.click.left = t.left + this.margins.left), "right" in t && (this.offset.click.left = this.helperProportions.width - t.right + this.margins.left), "top" in t && (this.offset.click.top = t.top + this.margins.top), "bottom" in t && (this.offset.click.top = this.helperProportions.height - t.bottom + this.margins.top)
        },
        _getParentOffset: function () {
            this.offsetParent = this.helper.offsetParent();
            var t = this.offsetParent.offset();
            this.cssPosition === "absolute" && this.scrollParent[0] !== document && e.contains(this.scrollParent[0], this.offsetParent[0]) && (t.left += this.scrollParent.scrollLeft(), t.top += this.scrollParent.scrollTop());
            if (this.offsetParent[0] === document.body || this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() === "html" && e.ui.ie) t = {
                top: 0,
                left: 0
            };
            return {
                top: t.top + (parseInt(this.offsetParent.css("borderTopWidth"), 10) || 0),
                left: t.left + (parseInt(this.offsetParent.css("borderLeftWidth"), 10) || 0)
            }
        },
        _getRelativeOffset: function () {
            if (this.cssPosition === "relative") {
                var e = this.element.position();
                return {
                    top: e.top - (parseInt(this.helper.css("top"), 10) || 0) + this.scrollParent.scrollTop(),
                    left: e.left - (parseInt(this.helper.css("left"), 10) || 0) + this.scrollParent.scrollLeft()
                }
            }
            return {
                top: 0,
                left: 0
            }
        },
        _cacheMargins: function () {
            this.margins = {
                left: parseInt(this.element.css("marginLeft"), 10) || 0,
                top: parseInt(this.element.css("marginTop"), 10) || 0,
                right: parseInt(this.element.css("marginRight"), 10) || 0,
                bottom: parseInt(this.element.css("marginBottom"), 10) || 0
            }
        },
        _cacheHelperProportions: function () {
            this.helperProportions = {
                width: this.helper.outerWidth(),
                height: this.helper.outerHeight()
            }
        },
        _setContainment: function () {
            var t, n, r, i = this.options;
            i.containment === "parent" && (i.containment = this.helper[0].parentNode);
            if (i.containment === "document" || i.containment === "window") this.containment = [i.containment === "document" ? 0 : e(window).scrollLeft() - this.offset.relative.left - this.offset.parent.left, i.containment === "document" ? 0 : e(window).scrollTop() - this.offset.relative.top - this.offset.parent.top, (i.containment === "document" ? 0 : e(window).scrollLeft()) + e(i.containment === "document" ? document : window).width() - this.helperProportions.width - this.margins.left, (i.containment === "document" ? 0 : e(window).scrollTop()) + (e(i.containment === "document" ? document : window).height() || document.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top];
            if (!/^(document|window|parent)$/.test(i.containment) && i.containment.constructor !== Array) {
                n = e(i.containment), r = n[0];
                if (!r) return;
                t = e(r).css("overflow") !== "hidden", this.containment = [(parseInt(e(r).css("borderLeftWidth"), 10) || 0) + (parseInt(e(r).css("paddingLeft"), 10) || 0), (parseInt(e(r).css("borderTopWidth"), 10) || 0) + (parseInt(e(r).css("paddingTop"), 10) || 0), (t ? Math.max(r.scrollWidth, r.offsetWidth) : r.offsetWidth) - (parseInt(e(r).css("borderRightWidth"), 10) || 0) - (parseInt(e(r).css("paddingRight"), 10) || 0) - this.helperProportions.width - this.margins.left - this.margins.right, (t ? Math.max(r.scrollHeight, r.offsetHeight) : r.offsetHeight) - (parseInt(e(r).css("borderBottomWidth"), 10) || 0) - (parseInt(e(r).css("paddingBottom"), 10) || 0) - this.helperProportions.height - this.margins.top - this.margins.bottom], this.relative_container = n
            } else i.containment.constructor === Array && (this.containment = i.containment)
        },
        _convertPositionTo: function (t, n) {
            n || (n = this.position);
            var r = t === "absolute" ? 1 : -1,
                i = this.cssPosition !== "absolute" || this.scrollParent[0] !== document && !! e.contains(this.scrollParent[0], this.offsetParent[0]) ? this.scrollParent : this.offsetParent,
                s = /(html|body)/i.test(i[0].tagName);
            return {
                top: n.top + this.offset.relative.top * r + this.offset.parent.top * r - (this.cssPosition === "fixed" ? -this.scrollParent.scrollTop() : s ? 0 : i.scrollTop()) * r,
                left: n.left + this.offset.relative.left * r + this.offset.parent.left * r - (this.cssPosition === "fixed" ? -this.scrollParent.scrollLeft() : s ? 0 : i.scrollLeft()) * r
            }
        },
        _generatePosition: function (t) {
            var n, r, i, s, o = this.options,
                u = this.cssPosition !== "absolute" || this.scrollParent[0] !== document && !! e.contains(this.scrollParent[0], this.offsetParent[0]) ? this.scrollParent : this.offsetParent,
                a = /(html|body)/i.test(u[0].tagName),
                f = t.pageX,
                l = t.pageY;
            return this.originalPosition && (this.containment && (this.relative_container ? (r = this.relative_container.offset(), n = [this.containment[0] + r.left, this.containment[1] + r.top, this.containment[2] + r.left, this.containment[3] + r.top]) : n = this.containment, t.pageX - this.offset.click.left < n[0] && (f = n[0] + this.offset.click.left), t.pageY - this.offset.click.top < n[1] && (l = n[1] + this.offset.click.top), t.pageX - this.offset.click.left > n[2] && (f = n[2] + this.offset.click.left), t.pageY - this.offset.click.top > n[3] && (l = n[3] + this.offset.click.top)), o.grid && (i = o.grid[1] ? this.originalPageY + Math.round((l - this.originalPageY) / o.grid[1]) * o.grid[1] : this.originalPageY, l = n ? i - this.offset.click.top >= n[1] || i - this.offset.click.top > n[3] ? i : i - this.offset.click.top >= n[1] ? i - o.grid[1] : i + o.grid[1] : i, s = o.grid[0] ? this.originalPageX + Math.round((f - this.originalPageX) / o.grid[0]) * o.grid[0] : this.originalPageX, f = n ? s - this.offset.click.left >= n[0] || s - this.offset.click.left > n[2] ? s : s - this.offset.click.left >= n[0] ? s - o.grid[0] : s + o.grid[0] : s)), {
                top: l - this.offset.click.top - this.offset.relative.top - this.offset.parent.top + (this.cssPosition === "fixed" ? -this.scrollParent.scrollTop() : a ? 0 : u.scrollTop()),
                left: f - this.offset.click.left - this.offset.relative.left - this.offset.parent.left + (this.cssPosition === "fixed" ? -this.scrollParent.scrollLeft() : a ? 0 : u.scrollLeft())
            }
        },
        _clear: function () {
            this.helper.removeClass("ui-draggable-dragging"), this.helper[0] !== this.element[0] && !this.cancelHelperRemoval && this.helper.remove(), this.helper = null, this.cancelHelperRemoval = !1
        },
        _trigger: function (t, n, r) {
            return r = r || this._uiHash(), e.ui.plugin.call(this, t, [n, r]), t === "drag" && (this.positionAbs = this._convertPositionTo("absolute")), e.Widget.prototype._trigger.call(this, t, n, r)
        },
        plugins: {},
        _uiHash: function () {
            return {
                helper: this.helper,
                position: this.position,
                originalPosition: this.originalPosition,
                offset: this.positionAbs
            }
        }
    }), e.ui.plugin.add("draggable", "connectToSortable", {
        start: function (t, n) {
            var r = e(this).data("ui-draggable"),
                i = r.options,
                s = e.extend({}, n, {
                    item: r.element
                });
            r.sortables = [], e(i.connectToSortable).each(function () {
                var n = e.data(this, "ui-sortable");
                n && !n.options.disabled && (r.sortables.push({
                    instance: n,
                    shouldRevert: n.options.revert
                }), n.refreshPositions(), n._trigger("activate", t, s))
            })
        },
        stop: function (t, n) {
            var r = e(this).data("ui-draggable"),
                i = e.extend({}, n, {
                    item: r.element
                });
            e.each(r.sortables, function () {
                this.instance.isOver ? (this.instance.isOver = 0, r.cancelHelperRemoval = !0, this.instance.cancelHelperRemoval = !1, this.shouldRevert && (this.instance.options.revert = this.shouldRevert), this.instance._mouseStop(t), this.instance.options.helper = this.instance.options._helper, r.options.helper === "original" && this.instance.currentItem.css({
                    top: "auto",
                    left: "auto"
                })) : (this.instance.cancelHelperRemoval = !1, this.instance._trigger("deactivate", t, i))
            })
        },
        drag: function (t, n) {
            var r = e(this).data("ui-draggable"),
                i = this;
            e.each(r.sortables, function () {
                var s = !1,
                    o = this;
                this.instance.positionAbs = r.positionAbs, this.instance.helperProportions = r.helperProportions, this.instance.offset.click = r.offset.click, this.instance._intersectsWith(this.instance.containerCache) && (s = !0, e.each(r.sortables, function () {
                    return this.instance.positionAbs = r.positionAbs, this.instance.helperProportions = r.helperProportions, this.instance.offset.click = r.offset.click, this !== o && this.instance._intersectsWith(this.instance.containerCache) && e.contains(o.instance.element[0], this.instance.element[0]) && (s = !1), s
                })), s ? (this.instance.isOver || (this.instance.isOver = 1, this.instance.currentItem = e(i).clone().removeAttr("id").appendTo(this.instance.element).data("ui-sortable-item", !0), this.instance.options._helper = this.instance.options.helper, this.instance.options.helper = function () {
                    return n.helper[0]
                }, t.target = this.instance.currentItem[0], this.instance._mouseCapture(t, !0), this.instance._mouseStart(t, !0, !0), this.instance.offset.click.top = r.offset.click.top, this.instance.offset.click.left = r.offset.click.left, this.instance.offset.parent.left -= r.offset.parent.left - this.instance.offset.parent.left, this.instance.offset.parent.top -= r.offset.parent.top - this.instance.offset.parent.top, r._trigger("toSortable", t), r.dropped = this.instance.element, r.currentItem = r.element, this.instance.fromOutside = r), this.instance.currentItem && this.instance._mouseDrag(t)) : this.instance.isOver && (this.instance.isOver = 0, this.instance.cancelHelperRemoval = !0, this.instance.options.revert = !1, this.instance._trigger("out", t, this.instance._uiHash(this.instance)), this.instance._mouseStop(t, !0), this.instance.options.helper = this.instance.options._helper, this.instance.currentItem.remove(), this.instance.placeholder && this.instance.placeholder.remove(), r._trigger("fromSortable", t), r.dropped = !1)
            })
        }
    }), e.ui.plugin.add("draggable", "cursor", {
        start: function () {
            var t = e("body"),
                n = e(this).data("ui-draggable").options;
            t.css("cursor") && (n._cursor = t.css("cursor")), t.css("cursor", n.cursor)
        },
        stop: function () {
            var t = e(this).data("ui-draggable").options;
            t._cursor && e("body").css("cursor", t._cursor)
        }
    }), e.ui.plugin.add("draggable", "opacity", {
        start: function (t, n) {
            var r = e(n.helper),
                i = e(this).data("ui-draggable").options;
            r.css("opacity") && (i._opacity = r.css("opacity")), r.css("opacity", i.opacity)
        },
        stop: function (t, n) {
            var r = e(this).data("ui-draggable").options;
            r._opacity && e(n.helper).css("opacity", r._opacity)
        }
    }), e.ui.plugin.add("draggable", "scroll", {
        start: function () {
            var t = e(this).data("ui-draggable");
            t.scrollParent[0] !== document && t.scrollParent[0].tagName !== "HTML" && (t.overflowOffset = t.scrollParent.offset())
        },
        drag: function (t) {
            var n = e(this).data("ui-draggable"),
                r = n.options,
                i = !1;
            if (n.scrollParent[0] !== document && n.scrollParent[0].tagName !== "HTML") {
                if (!r.axis || r.axis !== "x") n.overflowOffset.top + n.scrollParent[0].offsetHeight - t.pageY < r.scrollSensitivity ? n.scrollParent[0].scrollTop = i = n.scrollParent[0].scrollTop + r.scrollSpeed : t.pageY - n.overflowOffset.top < r.scrollSensitivity && (n.scrollParent[0].scrollTop = i = n.scrollParent[0].scrollTop - r.scrollSpeed);
                if (!r.axis || r.axis !== "y") n.overflowOffset.left + n.scrollParent[0].offsetWidth - t.pageX < r.scrollSensitivity ? n.scrollParent[0].scrollLeft = i = n.scrollParent[0].scrollLeft + r.scrollSpeed : t.pageX - n.overflowOffset.left < r.scrollSensitivity && (n.scrollParent[0].scrollLeft = i = n.scrollParent[0].scrollLeft - r.scrollSpeed)
            } else {
                if (!r.axis || r.axis !== "x") t.pageY - e(document).scrollTop() < r.scrollSensitivity ? i = e(document).scrollTop(e(document).scrollTop() - r.scrollSpeed) : e(window).height() - (t.pageY - e(document).scrollTop()) < r.scrollSensitivity && (i = e(document).scrollTop(e(document).scrollTop() + r.scrollSpeed));
                if (!r.axis || r.axis !== "y") t.pageX - e(document).scrollLeft() < r.scrollSensitivity ? i = e(document).scrollLeft(e(document).scrollLeft() - r.scrollSpeed) : e(window).width() - (t.pageX - e(document).scrollLeft()) < r.scrollSensitivity && (i = e(document).scrollLeft(e(document).scrollLeft() + r.scrollSpeed))
            }
            i !== !1 && e.ui.ddmanager && !r.dropBehaviour && e.ui.ddmanager.prepareOffsets(n, t)
        }
    }), e.ui.plugin.add("draggable", "snap", {
        start: function () {
            var t = e(this).data("ui-draggable"),
                n = t.options;
            t.snapElements = [], e(n.snap.constructor !== String ? n.snap.items || ":data(ui-draggable)" : n.snap).each(function () {
                var n = e(this),
                    r = n.offset();
                this !== t.element[0] && t.snapElements.push({
                    item: this,
                    width: n.outerWidth(),
                    height: n.outerHeight(),
                    top: r.top,
                    left: r.left
                })
            })
        },
        drag: function (t, n) {
            var r, i, s, o, u, a, f, l, c, h, p = e(this).data("ui-draggable"),
                d = p.options,
                v = d.snapTolerance,
                m = n.offset.left,
                g = m + p.helperProportions.width,
                y = n.offset.top,
                b = y + p.helperProportions.height;
            for (c = p.snapElements.length - 1; c >= 0; c--) {
                u = p.snapElements[c].left, a = u + p.snapElements[c].width, f = p.snapElements[c].top, l = f + p.snapElements[c].height;
                if (!(u - v < m && m < a + v && f - v < y && y < l + v || u - v < m && m < a + v && f - v < b && b < l + v || u - v < g && g < a + v && f - v < y && y < l + v || u - v < g && g < a + v && f - v < b && b < l + v)) {
                    p.snapElements[c].snapping && p.options.snap.release && p.options.snap.release.call(p.element, t, e.extend(p._uiHash(), {
                        snapItem: p.snapElements[c].item
                    })), p.snapElements[c].snapping = !1;
                    continue
                }
                d.snapMode !== "inner" && (r = Math.abs(f - b) <= v, i = Math.abs(l - y) <= v, s = Math.abs(u - g) <= v, o = Math.abs(a - m) <= v, r && (n.position.top = p._convertPositionTo("relative", {
                    top: f - p.helperProportions.height,
                    left: 0
                }).top - p.margins.top), i && (n.position.top = p._convertPositionTo("relative", {
                    top: l,
                    left: 0
                }).top - p.margins.top), s && (n.position.left = p._convertPositionTo("relative", {
                    top: 0,
                    left: u - p.helperProportions.width
                }).left - p.margins.left), o && (n.position.left = p._convertPositionTo("relative", {
                    top: 0,
                    left: a
                }).left - p.margins.left)), h = r || i || s || o, d.snapMode !== "outer" && (r = Math.abs(f - y) <= v, i = Math.abs(l - b) <= v, s = Math.abs(u - m) <= v, o = Math.abs(a - g) <= v, r && (n.position.top = p._convertPositionTo("relative", {
                    top: f,
                    left: 0
                }).top - p.margins.top), i && (n.position.top = p._convertPositionTo("relative", {
                    top: l - p.helperProportions.height,
                    left: 0
                }).top - p.margins.top), s && (n.position.left = p._convertPositionTo("relative", {
                    top: 0,
                    left: u
                }).left - p.margins.left), o && (n.position.left = p._convertPositionTo("relative", {
                    top: 0,
                    left: a - p.helperProportions.width
                }).left - p.margins.left)), !p.snapElements[c].snapping && (r || i || s || o || h) && p.options.snap.snap && p.options.snap.snap.call(p.element, t, e.extend(p._uiHash(), {
                    snapItem: p.snapElements[c].item
                })), p.snapElements[c].snapping = r || i || s || o || h
            }
        }
    }), e.ui.plugin.add("draggable", "stack", {
        start: function () {
            var t, n = this.data("ui-draggable").options,
                r = e.makeArray(e(n.stack)).sort(function (t, n) {
                    return (parseInt(e(t).css("zIndex"), 10) || 0) - (parseInt(e(n).css("zIndex"), 10) || 0)
                });
            if (!r.length) return;
            t = parseInt(e(r[0]).css("zIndex"), 10) || 0, e(r).each(function (n) {
                e(this).css("zIndex", t + n)
            }), this.css("zIndex", t + r.length)
        }
    }), e.ui.plugin.add("draggable", "zIndex", {
        start: function (t, n) {
            var r = e(n.helper),
                i = e(this).data("ui-draggable").options;
            r.css("zIndex") && (i._zIndex = r.css("zIndex")), r.css("zIndex", i.zIndex)
        },
        stop: function (t, n) {
            var r = e(this).data("ui-draggable").options;
            r._zIndex && e(n.helper).css("zIndex", r._zIndex)
        }
    })
}(jQuery),
function (e, t) {
    function n(e, t, n) {
        return e > t && e < t + n
    }
    e.widget("ui.droppable", {
        version: "1.10.2",
        widgetEventPrefix: "drop",
        options: {
            accept: "*",
            activeClass: !1,
            addClasses: !0,
            greedy: !1,
            hoverClass: !1,
            scope: "default",
            tolerance: "intersect",
            activate: null,
            deactivate: null,
            drop: null,
            out: null,
            over: null
        },
        _create: function () {
            var t = this.options,
                n = t.accept;
            this.isover = !1, this.isout = !0, this.accept = e.isFunction(n) ? n : function (e) {
                return e.is(n)
            }, this.proportions = {
                width: this.element[0].offsetWidth,
                height: this.element[0].offsetHeight
            }, e.ui.ddmanager.droppables[t.scope] = e.ui.ddmanager.droppables[t.scope] || [], e.ui.ddmanager.droppables[t.scope].push(this), t.addClasses && this.element.addClass("ui-droppable")
        },
        _destroy: function () {
            var t = 0,
                n = e.ui.ddmanager.droppables[this.options.scope];
            for (; t < n.length; t++) n[t] === this && n.splice(t, 1);
            this.element.removeClass("ui-droppable ui-droppable-disabled")
        },
        _setOption: function (t, n) {
            t === "accept" && (this.accept = e.isFunction(n) ? n : function (e) {
                return e.is(n)
            }), e.Widget.prototype._setOption.apply(this, arguments)
        },
        _activate: function (t) {
            var n = e.ui.ddmanager.current;
            this.options.activeClass && this.element.addClass(this.options.activeClass), n && this._trigger("activate", t, this.ui(n))
        },
        _deactivate: function (t) {
            var n = e.ui.ddmanager.current;
            this.options.activeClass && this.element.removeClass(this.options.activeClass), n && this._trigger("deactivate", t, this.ui(n))
        },
        _over: function (t) {
            var n = e.ui.ddmanager.current;
            if (!n || (n.currentItem || n.element)[0] === this.element[0]) return;
            this.accept.call(this.element[0], n.currentItem || n.element) && (this.options.hoverClass && this.element.addClass(this.options.hoverClass), this._trigger("over", t, this.ui(n)))
        },
        _out: function (t) {
            var n = e.ui.ddmanager.current;
            if (!n || (n.currentItem || n.element)[0] === this.element[0]) return;
            this.accept.call(this.element[0], n.currentItem || n.element) && (this.options.hoverClass && this.element.removeClass(this.options.hoverClass), this._trigger("out", t, this.ui(n)))
        },
        _drop: function (t, n) {
            var r = n || e.ui.ddmanager.current,
                i = !1;
            return !r || (r.currentItem || r.element)[0] === this.element[0] ? !1 : (this.element.find(":data(ui-droppable)").not(".ui-draggable-dragging").each(function () {
                var t = e.data(this, "ui-droppable");
                if (t.options.greedy && !t.options.disabled && t.options.scope === r.options.scope && t.accept.call(t.element[0], r.currentItem || r.element) && e.ui.intersect(r, e.extend(t, {
                    offset: t.element.offset()
                }), t.options.tolerance)) return i = !0, !1
            }), i ? !1 : this.accept.call(this.element[0], r.currentItem || r.element) ? (this.options.activeClass && this.element.removeClass(this.options.activeClass), this.options.hoverClass && this.element.removeClass(this.options.hoverClass), this._trigger("drop", t, this.ui(r)), this.element) : !1)
        },
        ui: function (e) {
            return {
                draggable: e.currentItem || e.element,
                helper: e.helper,
                position: e.position,
                offset: e.positionAbs
            }
        }
    }), e.ui.intersect = function (e, t, r) {
        if (!t.offset) return !1;
        var i, s, o = (e.positionAbs || e.position.absolute).left,
            u = o + e.helperProportions.width,
            a = (e.positionAbs || e.position.absolute).top,
            f = a + e.helperProportions.height,
            l = t.offset.left,
            c = l + t.proportions.width,
            h = t.offset.top,
            p = h + t.proportions.height;
        switch (r) {
        case "fit":
            return l <= o && u <= c && h <= a && f <= p;
        case "intersect":
            return l < o + e.helperProportions.width / 2 && u - e.helperProportions.width / 2 < c && h < a + e.helperProportions.height / 2 && f - e.helperProportions.height / 2 < p;
        case "pointer":
            return i = (e.positionAbs || e.position.absolute).left + (e.clickOffset || e.offset.click).left, s = (e.positionAbs || e.position.absolute).top + (e.clickOffset || e.offset.click).top, n(s, h, t.proportions.height) && n(i, l, t.proportions.width);
        case "touch":
            return (a >= h && a <= p || f >= h && f <= p || a < h && f > p) && (o >= l && o <= c || u >= l && u <= c || o < l && u > c);
        default:
            return !1
        }
    }, e.ui.ddmanager = {
        current: null,
        droppables: {
            "default": []
        },
        prepareOffsets: function (t, n) {
            var r, i, s = e.ui.ddmanager.droppables[t.options.scope] || [],
                o = n ? n.type : null,
                u = (t.currentItem || t.element).find(":data(ui-droppable)").addBack();
            e: for (r = 0; r < s.length; r++) {
                if (s[r].options.disabled || t && !s[r].accept.call(s[r].element[0], t.currentItem || t.element)) continue;
                for (i = 0; i < u.length; i++)
                    if (u[i] === s[r].element[0]) {
                        s[r].proportions.height = 0;
                        continue e
                    }
                s[r].visible = s[r].element.css("display") !== "none";
                if (!s[r].visible) continue;
                o === "mousedown" && s[r]._activate.call(s[r], n), s[r].offset = s[r].element.offset(), s[r].proportions = {
                    width: s[r].element[0].offsetWidth,
                    height: s[r].element[0].offsetHeight
                }
            }
        },
        drop: function (t, n) {
            var r = !1;
            return e.each((e.ui.ddmanager.droppables[t.options.scope] || []).slice(), function () {
                if (!this.options) return;
                !this.options.disabled && this.visible && e.ui.intersect(t, this, this.options.tolerance) && (r = this._drop.call(this, n) || r), !this.options.disabled && this.visible && this.accept.call(this.element[0], t.currentItem || t.element) && (this.isout = !0, this.isover = !1, this._deactivate.call(this, n))
            }), r
        },
        dragStart: function (t, n) {
            t.element.parentsUntil("body").bind("scroll.droppable", function () {
                t.options.refreshPositions || e.ui.ddmanager.prepareOffsets(t, n)
            })
        },
        drag: function (t, n) {
            t.options.refreshPositions && e.ui.ddmanager.prepareOffsets(t, n), e.each(e.ui.ddmanager.droppables[t.options.scope] || [], function () {
                if (this.options.disabled || this.greedyChild || !this.visible) return;
                var r, i, s, o = e.ui.intersect(t, this, this.options.tolerance),
                    u = !o && this.isover ? "isout" : o && !this.isover ? "isover" : null;
                if (!u) return;
                this.options.greedy && (i = this.options.scope, s = this.element.parents(":data(ui-droppable)").filter(function () {
                    return e.data(this, "ui-droppable").options.scope === i
                }), s.length && (r = e.data(s[0], "ui-droppable"), r.greedyChild = u === "isover")), r && u === "isover" && (r.isover = !1, r.isout = !0, r._out.call(r, n)), this[u] = !0, this[u === "isout" ? "isover" : "isout"] = !1, this[u === "isover" ? "_over" : "_out"].call(this, n), r && u === "isout" && (r.isout = !1, r.isover = !0, r._over.call(r, n))
            })
        },
        dragStop: function (t, n) {
            t.element.parentsUntil("body").unbind("scroll.droppable"), t.options.refreshPositions || e.ui.ddmanager.prepareOffsets(t, n)
        }
    }
}(jQuery),
function (e, t) {
    function n(e) {
        return parseInt(e, 10) || 0
    }

    function r(e) {
        return !isNaN(parseInt(e, 10))
    }
    e.widget("ui.resizable", e.ui.mouse, {
        version: "1.10.2",
        widgetEventPrefix: "resize",
        options: {
            alsoResize: !1,
            animate: !1,
            animateDuration: "slow",
            animateEasing: "swing",
            aspectRatio: !1,
            autoHide: !1,
            containment: !1,
            ghost: !1,
            grid: !1,
            handles: "e,s,se",
            helper: !1,
            maxHeight: null,
            maxWidth: null,
            minHeight: 10,
            minWidth: 10,
            zIndex: 90,
            resize: null,
            start: null,
            stop: null
        },
        _create: function () {
            var t, n, r, i, s, o = this,
                u = this.options;
            this.element.addClass("ui-resizable"), e.extend(this, {
                _aspectRatio: !! u.aspectRatio,
                aspectRatio: u.aspectRatio,
                originalElement: this.element,
                _proportionallyResizeElements: [],
                _helper: u.helper || u.ghost || u.animate ? u.helper || "ui-resizable-helper" : null
            }), this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i) && (this.element.wrap(e("<div class='ui-wrapper' style='overflow: hidden;'></div>").css({
                position: this.element.css("position"),
                width: this.element.outerWidth(),
                height: this.element.outerHeight(),
                top: this.element.css("top"),
                left: this.element.css("left")
            })), this.element = this.element.parent().data("ui-resizable", this.element.data("ui-resizable")), this.elementIsWrapper = !0, this.element.css({
                marginLeft: this.originalElement.css("marginLeft"),
                marginTop: this.originalElement.css("marginTop"),
                marginRight: this.originalElement.css("marginRight"),
                marginBottom: this.originalElement.css("marginBottom")
            }), this.originalElement.css({
                marginLeft: 0,
                marginTop: 0,
                marginRight: 0,
                marginBottom: 0
            }), this.originalResizeStyle = this.originalElement.css("resize"), this.originalElement.css("resize", "none"), this._proportionallyResizeElements.push(this.originalElement.css({
                position: "static",
                zoom: 1,
                display: "block"
            })), this.originalElement.css({
                margin: this.originalElement.css("margin")
            }), this._proportionallyResize()), this.handles = u.handles || (e(".ui-resizable-handle", this.element).length ? {
                n: ".ui-resizable-n",
                e: ".ui-resizable-e",
                s: ".ui-resizable-s",
                w: ".ui-resizable-w",
                se: ".ui-resizable-se",
                sw: ".ui-resizable-sw",
                ne: ".ui-resizable-ne",
                nw: ".ui-resizable-nw"
            } : "e,s,se");
            if (this.handles.constructor === String) {
                this.handles === "all" && (this.handles = "n,e,s,w,se,sw,ne,nw"), t = this.handles.split(","), this.handles = {};
                for (n = 0; n < t.length; n++) r = e.trim(t[n]), s = "ui-resizable-" + r, i = e("<div class='ui-resizable-handle " + s + "'></div>"), i.css({
                    zIndex: u.zIndex
                }), "se" === r && i.addClass("ui-icon ui-icon-gripsmall-diagonal-se"), this.handles[r] = ".ui-resizable-" + r, this.element.append(i)
            }
            this._renderAxis = function (t) {
                var n, r, i, s;
                t = t || this.element;
                for (n in this.handles) {
                    this.handles[n].constructor === String && (this.handles[n] = e(this.handles[n], this.element).show()), this.elementIsWrapper && this.originalElement[0].nodeName.match(/textarea|input|select|button/i) && (r = e(this.handles[n], this.element), s = /sw|ne|nw|se|n|s/.test(n) ? r.outerHeight() : r.outerWidth(), i = ["padding", /ne|nw|n/.test(n) ? "Top" : /se|sw|s/.test(n) ? "Bottom" : /^e$/.test(n) ? "Right" : "Left"].join(""), t.css(i, s), this._proportionallyResize());
                    if (!e(this.handles[n]).length) continue
                }
            }, this._renderAxis(this.element), this._handles = e(".ui-resizable-handle", this.element).disableSelection(), this._handles.mouseover(function () {
                o.resizing || (this.className && (i = this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)), o.axis = i && i[1] ? i[1] : "se")
            }), u.autoHide && (this._handles.hide(), e(this.element).addClass("ui-resizable-autohide").mouseenter(function () {
                if (u.disabled) return;
                e(this).removeClass("ui-resizable-autohide"), o._handles.show()
            }).mouseleave(function () {
                if (u.disabled) return;
                o.resizing || (e(this).addClass("ui-resizable-autohide"), o._handles.hide())
            })), this._mouseInit()
        },
        _destroy: function () {
            this._mouseDestroy();
            var t, n = function (t) {
                    e(t).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").removeData("ui-resizable").unbind(".resizable").find(".ui-resizable-handle").remove()
                };
            return this.elementIsWrapper && (n(this.element), t = this.element, this.originalElement.css({
                position: t.css("position"),
                width: t.outerWidth(),
                height: t.outerHeight(),
                top: t.css("top"),
                left: t.css("left")
            }).insertAfter(t), t.remove()), this.originalElement.css("resize", this.originalResizeStyle), n(this.originalElement), this
        },
        _mouseCapture: function (t) {
            var n, r, i = !1;
            for (n in this.handles) {
                r = e(this.handles[n])[0];
                if (r === t.target || e.contains(r, t.target)) i = !0
            }
            return !this.options.disabled && i
        },
        _mouseStart: function (t) {
            var r, i, s, o = this.options,
                u = this.element.position(),
                a = this.element;
            return this.resizing = !0, /absolute/.test(a.css("position")) ? a.css({
                position: "absolute",
                top: a.css("top"),
                left: a.css("left")
            }) : a.is(".ui-draggable") && a.css({
                position: "absolute",
                top: u.top,
                left: u.left
            }), this._renderProxy(), r = n(this.helper.css("left")), i = n(this.helper.css("top")), o.containment && (r += e(o.containment).scrollLeft() || 0, i += e(o.containment).scrollTop() || 0), this.offset = this.helper.offset(), this.position = {
                left: r,
                top: i
            }, this.size = this._helper ? {
                width: a.outerWidth(),
                height: a.outerHeight()
            } : {
                width: a.width(),
                height: a.height()
            }, this.originalSize = this._helper ? {
                width: a.outerWidth(),
                height: a.outerHeight()
            } : {
                width: a.width(),
                height: a.height()
            }, this.originalPosition = {
                left: r,
                top: i
            }, this.sizeDiff = {
                width: a.outerWidth() - a.width(),
                height: a.outerHeight() - a.height()
            }, this.originalMousePosition = {
                left: t.pageX,
                top: t.pageY
            }, this.aspectRatio = typeof o.aspectRatio == "number" ? o.aspectRatio : this.originalSize.width / this.originalSize.height || 1, s = e(".ui-resizable-" + this.axis).css("cursor"), e("body").css("cursor", s === "auto" ? this.axis + "-resize" : s), a.addClass("ui-resizable-resizing"), this._propagate("start", t), !0
        },
        _mouseDrag: function (t) {
            var n, r = this.helper,
                i = {}, s = this.originalMousePosition,
                o = this.axis,
                u = this.position.top,
                a = this.position.left,
                f = this.size.width,
                l = this.size.height,
                c = t.pageX - s.left || 0,
                h = t.pageY - s.top || 0,
                p = this._change[o];
            if (!p) return !1;
            n = p.apply(this, [t, c, h]), this._updateVirtualBoundaries(t.shiftKey);
            if (this._aspectRatio || t.shiftKey) n = this._updateRatio(n, t);
            return n = this._respectSize(n, t), this._updateCache(n), this._propagate("resize", t), this.position.top !== u && (i.top = this.position.top + "px"), this.position.left !== a && (i.left = this.position.left + "px"), this.size.width !== f && (i.width = this.size.width + "px"), this.size.height !== l && (i.height = this.size.height + "px"), r.css(i), !this._helper && this._proportionallyResizeElements.length && this._proportionallyResize(), e.isEmptyObject(i) || this._trigger("resize", t, this.ui()), !1
        },
        _mouseStop: function (t) {
            this.resizing = !1;
            var n, r, i, s, o, u, a, f = this.options,
                l = this;
            return this._helper && (n = this._proportionallyResizeElements, r = n.length && /textarea/i.test(n[0].nodeName), i = r && e.ui.hasScroll(n[0], "left") ? 0 : l.sizeDiff.height, s = r ? 0 : l.sizeDiff.width, o = {
                width: l.helper.width() - s,
                height: l.helper.height() - i
            }, u = parseInt(l.element.css("left"), 10) + (l.position.left - l.originalPosition.left) || null, a = parseInt(l.element.css("top"), 10) + (l.position.top - l.originalPosition.top) || null, f.animate || this.element.css(e.extend(o, {
                top: a,
                left: u
            })), l.helper.height(l.size.height), l.helper.width(l.size.width), this._helper && !f.animate && this._proportionallyResize()), e("body").css("cursor", "auto"), this.element.removeClass("ui-resizable-resizing"), this._propagate("stop", t), this._helper && this.helper.remove(), !1
        },
        _updateVirtualBoundaries: function (e) {
            var t, n, i, s, o, u = this.options;
            o = {
                minWidth: r(u.minWidth) ? u.minWidth : 0,
                maxWidth: r(u.maxWidth) ? u.maxWidth : Infinity,
                minHeight: r(u.minHeight) ? u.minHeight : 0,
                maxHeight: r(u.maxHeight) ? u.maxHeight : Infinity
            };
            if (this._aspectRatio || e) t = o.minHeight * this.aspectRatio, i = o.minWidth / this.aspectRatio, n = o.maxHeight * this.aspectRatio, s = o.maxWidth / this.aspectRatio, t > o.minWidth && (o.minWidth = t), i > o.minHeight && (o.minHeight = i), n < o.maxWidth && (o.maxWidth = n), s < o.maxHeight && (o.maxHeight = s);
            this._vBoundaries = o
        },
        _updateCache: function (e) {
            this.offset = this.helper.offset(), r(e.left) && (this.position.left = e.left), r(e.top) && (this.position.top = e.top), r(e.height) && (this.size.height = e.height), r(e.width) && (this.size.width = e.width)
        },
        _updateRatio: function (e) {
            var t = this.position,
                n = this.size,
                i = this.axis;
            return r(e.height) ? e.width = e.height * this.aspectRatio : r(e.width) && (e.height = e.width / this.aspectRatio), i === "sw" && (e.left = t.left + (n.width - e.width), e.top = null), i === "nw" && (e.top = t.top + (n.height - e.height), e.left = t.left + (n.width - e.width)), e
        },
        _respectSize: function (e) {
            var t = this._vBoundaries,
                n = this.axis,
                i = r(e.width) && t.maxWidth && t.maxWidth < e.width,
                s = r(e.height) && t.maxHeight && t.maxHeight < e.height,
                o = r(e.width) && t.minWidth && t.minWidth > e.width,
                u = r(e.height) && t.minHeight && t.minHeight > e.height,
                a = this.originalPosition.left + this.originalSize.width,
                f = this.position.top + this.size.height,
                l = /sw|nw|w/.test(n),
                c = /nw|ne|n/.test(n);
            return o && (e.width = t.minWidth), u && (e.height = t.minHeight), i && (e.width = t.maxWidth), s && (e.height = t.maxHeight), o && l && (e.left = a - t.minWidth), i && l && (e.left = a - t.maxWidth), u && c && (e.top = f - t.minHeight), s && c && (e.top = f - t.maxHeight), !e.width && !e.height && !e.left && e.top ? e.top = null : !e.width && !e.height && !e.top && e.left && (e.left = null), e
        },
        _proportionallyResize: function () {
            if (!this._proportionallyResizeElements.length) return;
            var e, t, n, r, i, s = this.helper || this.element;
            for (e = 0; e < this._proportionallyResizeElements.length; e++) {
                i = this._proportionallyResizeElements[e];
                if (!this.borderDif) {
                    this.borderDif = [], n = [i.css("borderTopWidth"), i.css("borderRightWidth"), i.css("borderBottomWidth"), i.css("borderLeftWidth")], r = [i.css("paddingTop"), i.css("paddingRight"), i.css("paddingBottom"), i.css("paddingLeft")];
                    for (t = 0; t < n.length; t++) this.borderDif[t] = (parseInt(n[t], 10) || 0) + (parseInt(r[t], 10) || 0)
                }
                i.css({
                    height: s.height() - this.borderDif[0] - this.borderDif[2] || 0,
                    width: s.width() - this.borderDif[1] - this.borderDif[3] || 0
                })
            }
        },
        _renderProxy: function () {
            var t = this.element,
                n = this.options;
            this.elementOffset = t.offset(), this._helper ? (this.helper = this.helper || e("<div style='overflow:hidden;'></div>"), this.helper.addClass(this._helper).css({
                width: this.element.outerWidth() - 1,
                height: this.element.outerHeight() - 1,
                position: "absolute",
                left: this.elementOffset.left + "px",
                top: this.elementOffset.top + "px",
                zIndex: ++n.zIndex
            }), this.helper.appendTo("body").disableSelection()) : this.helper = this.element
        },
        _change: {
            e: function (e, t) {
                return {
                    width: this.originalSize.width + t
                }
            },
            w: function (e, t) {
                var n = this.originalSize,
                    r = this.originalPosition;
                return {
                    left: r.left + t,
                    width: n.width - t
                }
            },
            n: function (e, t, n) {
                var r = this.originalSize,
                    i = this.originalPosition;
                return {
                    top: i.top + n,
                    height: r.height - n
                }
            },
            s: function (e, t, n) {
                return {
                    height: this.originalSize.height + n
                }
            },
            se: function (t, n, r) {
                return e.extend(this._change.s.apply(this, arguments), this._change.e.apply(this, [t, n, r]))
            },
            sw: function (t, n, r) {
                return e.extend(this._change.s.apply(this, arguments), this._change.w.apply(this, [t, n, r]))
            },
            ne: function (t, n, r) {
                return e.extend(this._change.n.apply(this, arguments), this._change.e.apply(this, [t, n, r]))
            },
            nw: function (t, n, r) {
                return e.extend(this._change.n.apply(this, arguments), this._change.w.apply(this, [t, n, r]))
            }
        },
        _propagate: function (t, n) {
            e.ui.plugin.call(this, t, [n, this.ui()]), t !== "resize" && this._trigger(t, n, this.ui())
        },
        plugins: {},
        ui: function () {
            return {
                originalElement: this.originalElement,
                element: this.element,
                helper: this.helper,
                position: this.position,
                size: this.size,
                originalSize: this.originalSize,
                originalPosition: this.originalPosition
            }
        }
    }), e.ui.plugin.add("resizable", "animate", {
        stop: function (t) {
            var n = e(this).data("ui-resizable"),
                r = n.options,
                i = n._proportionallyResizeElements,
                s = i.length && /textarea/i.test(i[0].nodeName),
                o = s && e.ui.hasScroll(i[0], "left") ? 0 : n.sizeDiff.height,
                u = s ? 0 : n.sizeDiff.width,
                a = {
                    width: n.size.width - u,
                    height: n.size.height - o
                }, f = parseInt(n.element.css("left"), 10) + (n.position.left - n.originalPosition.left) || null,
                l = parseInt(n.element.css("top"), 10) + (n.position.top - n.originalPosition.top) || null;
            n.element.animate(e.extend(a, l && f ? {
                top: l,
                left: f
            } : {}), {
                duration: r.animateDuration,
                easing: r.animateEasing,
                step: function () {
                    var r = {
                        width: parseInt(n.element.css("width"), 10),
                        height: parseInt(n.element.css("height"), 10),
                        top: parseInt(n.element.css("top"), 10),
                        left: parseInt(n.element.css("left"), 10)
                    };
                    i && i.length && e(i[0]).css({
                        width: r.width,
                        height: r.height
                    }), n._updateCache(r), n._propagate("resize", t)
                }
            })
        }
    }), e.ui.plugin.add("resizable", "containment", {
        start: function () {
            var t, r, i, s, o, u, a, f = e(this).data("ui-resizable"),
                l = f.options,
                c = f.element,
                h = l.containment,
                p = h instanceof e ? h.get(0) : /parent/.test(h) ? c.parent().get(0) : h;
            if (!p) return;
            f.containerElement = e(p), /document/.test(h) || h === document ? (f.containerOffset = {
                left: 0,
                top: 0
            }, f.containerPosition = {
                left: 0,
                top: 0
            }, f.parentData = {
                element: e(document),
                left: 0,
                top: 0,
                width: e(document).width(),
                height: e(document).height() || document.body.parentNode.scrollHeight
            }) : (t = e(p), r = [], e(["Top", "Right", "Left", "Bottom"]).each(function (e, i) {
                r[e] = n(t.css("padding" + i))
            }), f.containerOffset = t.offset(), f.containerPosition = t.position(), f.containerSize = {
                height: t.innerHeight() - r[3],
                width: t.innerWidth() - r[1]
            }, i = f.containerOffset, s = f.containerSize.height, o = f.containerSize.width, u = e.ui.hasScroll(p, "left") ? p.scrollWidth : o, a = e.ui.hasScroll(p) ? p.scrollHeight : s, f.parentData = {
                element: p,
                left: i.left,
                top: i.top,
                width: u,
                height: a
            })
        },
        resize: function (t) {
            var n, r, i, s, o = e(this).data("ui-resizable"),
                u = o.options,
                a = o.containerOffset,
                f = o.position,
                l = o._aspectRatio || t.shiftKey,
                c = {
                    top: 0,
                    left: 0
                }, h = o.containerElement;
            h[0] !== document && /static/.test(h.css("position")) && (c = a), f.left < (o._helper ? a.left : 0) && (o.size.width = o.size.width + (o._helper ? o.position.left - a.left : o.position.left - c.left), l && (o.size.height = o.size.width / o.aspectRatio), o.position.left = u.helper ? a.left : 0), f.top < (o._helper ? a.top : 0) && (o.size.height = o.size.height + (o._helper ? o.position.top - a.top : o.position.top), l && (o.size.width = o.size.height * o.aspectRatio), o.position.top = o._helper ? a.top : 0), o.offset.left = o.parentData.left + o.position.left, o.offset.top = o.parentData.top + o.position.top, n = Math.abs((o._helper ? o.offset.left - c.left : o.offset.left - c.left) + o.sizeDiff.width), r = Math.abs((o._helper ? o.offset.top - c.top : o.offset.top - a.top) + o.sizeDiff.height), i = o.containerElement.get(0) === o.element.parent().get(0), s = /relative|absolute/.test(o.containerElement.css("position")), i && s && (n -= o.parentData.left), n + o.size.width >= o.parentData.width && (o.size.width = o.parentData.width - n, l && (o.size.height = o.size.width / o.aspectRatio)), r + o.size.height >= o.parentData.height && (o.size.height = o.parentData.height - r, l && (o.size.width = o.size.height * o.aspectRatio))
        },
        stop: function () {
            var t = e(this).data("ui-resizable"),
                n = t.options,
                r = t.containerOffset,
                i = t.containerPosition,
                s = t.containerElement,
                o = e(t.helper),
                u = o.offset(),
                a = o.outerWidth() - t.sizeDiff.width,
                f = o.outerHeight() - t.sizeDiff.height;
            t._helper && !n.animate && /relative/.test(s.css("position")) && e(this).css({
                left: u.left - i.left - r.left,
                width: a,
                height: f
            }), t._helper && !n.animate && /static/.test(s.css("position")) && e(this).css({
                left: u.left - i.left - r.left,
                width: a,
                height: f
            })
        }
    }), e.ui.plugin.add("resizable", "alsoResize", {
        start: function () {
            var t = e(this).data("ui-resizable"),
                n = t.options,
                r = function (t) {
                    e(t).each(function () {
                        var t = e(this);
                        t.data("ui-resizable-alsoresize", {
                            width: parseInt(t.width(), 10),
                            height: parseInt(t.height(), 10),
                            left: parseInt(t.css("left"), 10),
                            top: parseInt(t.css("top"), 10)
                        })
                    })
                };
            typeof n.alsoResize == "object" && !n.alsoResize.parentNode ? n.alsoResize.length ? (n.alsoResize = n.alsoResize[0], r(n.alsoResize)) : e.each(n.alsoResize, function (e) {
                r(e)
            }) : r(n.alsoResize)
        },
        resize: function (t, n) {
            var r = e(this).data("ui-resizable"),
                i = r.options,
                s = r.originalSize,
                o = r.originalPosition,
                u = {
                    height: r.size.height - s.height || 0,
                    width: r.size.width - s.width || 0,
                    top: r.position.top - o.top || 0,
                    left: r.position.left - o.left || 0
                }, a = function (t, r) {
                    e(t).each(function () {
                        var t = e(this),
                            i = e(this).data("ui-resizable-alsoresize"),
                            s = {}, o = r && r.length ? r : t.parents(n.originalElement[0]).length ? ["width", "height"] : ["width", "height", "top", "left"];
                        e.each(o, function (e, t) {
                            var n = (i[t] || 0) + (u[t] || 0);
                            n && n >= 0 && (s[t] = n || null)
                        }), t.css(s)
                    })
                };
            typeof i.alsoResize == "object" && !i.alsoResize.nodeType ? e.each(i.alsoResize, function (e, t) {
                a(e, t)
            }) : a(i.alsoResize)
        },
        stop: function () {
            e(this).removeData("resizable-alsoresize")
        }
    }), e.ui.plugin.add("resizable", "ghost", {
        start: function () {
            var t = e(this).data("ui-resizable"),
                n = t.options,
                r = t.size;
            t.ghost = t.originalElement.clone(), t.ghost.css({
                opacity: .25,
                display: "block",
                position: "relative",
                height: r.height,
                width: r.width,
                margin: 0,
                left: 0,
                top: 0
            }).addClass("ui-resizable-ghost").addClass(typeof n.ghost == "string" ? n.ghost : ""), t.ghost.appendTo(t.helper)
        },
        resize: function () {
            var t = e(this).data("ui-resizable");
            t.ghost && t.ghost.css({
                position: "relative",
                height: t.size.height,
                width: t.size.width
            })
        },
        stop: function () {
            var t = e(this).data("ui-resizable");
            t.ghost && t.helper && t.helper.get(0).removeChild(t.ghost.get(0))
        }
    }), e.ui.plugin.add("resizable", "grid", {
        resize: function () {
            var t = e(this).data("ui-resizable"),
                n = t.options,
                r = t.size,
                i = t.originalSize,
                s = t.originalPosition,
                o = t.axis,
                u = typeof n.grid == "number" ? [n.grid, n.grid] : n.grid,
                a = u[0] || 1,
                f = u[1] || 1,
                l = Math.round((r.width - i.width) / a) * a,
                c = Math.round((r.height - i.height) / f) * f,
                h = i.width + l,
                p = i.height + c,
                d = n.maxWidth && n.maxWidth < h,
                v = n.maxHeight && n.maxHeight < p,
                m = n.minWidth && n.minWidth > h,
                g = n.minHeight && n.minHeight > p;
            n.grid = u, m && (h += a), g && (p += f), d && (h -= a), v && (p -= f), /^(se|s|e)$/.test(o) ? (t.size.width = h, t.size.height = p) : /^(ne)$/.test(o) ? (t.size.width = h, t.size.height = p, t.position.top = s.top - c) : /^(sw)$/.test(o) ? (t.size.width = h, t.size.height = p, t.position.left = s.left - l) : (t.size.width = h, t.size.height = p, t.position.top = s.top - c, t.position.left = s.left - l)
        }
    })
}(jQuery),
function (e, t) {
    e.widget("ui.selectable", e.ui.mouse, {
        version: "1.10.2",
        options: {
            appendTo: "body",
            autoRefresh: !0,
            distance: 0,
            filter: "*",
            tolerance: "touch",
            selected: null,
            selecting: null,
            start: null,
            stop: null,
            unselected: null,
            unselecting: null
        },
        _create: function () {
            var t, n = this;
            this.element.addClass("ui-selectable"), this.dragged = !1, this.refresh = function () {
                t = e(n.options.filter, n.element[0]), t.addClass("ui-selectee"), t.each(function () {
                    var t = e(this),
                        n = t.offset();
                    e.data(this, "selectable-item", {
                        element: this,
                        $element: t,
                        left: n.left,
                        top: n.top,
                        right: n.left + t.outerWidth(),
                        bottom: n.top + t.outerHeight(),
                        startselected: !1,
                        selected: t.hasClass("ui-selected"),
                        selecting: t.hasClass("ui-selecting"),
                        unselecting: t.hasClass("ui-unselecting")
                    })
                })
            }, this.refresh(), this.selectees = t.addClass("ui-selectee"), this._mouseInit(), this.helper = e("<div class='ui-selectable-helper'></div>")
        },
        _destroy: function () {
            this.selectees.removeClass("ui-selectee").removeData("selectable-item"), this.element.removeClass("ui-selectable ui-selectable-disabled"), this._mouseDestroy()
        },
        _mouseStart: function (t) {
            var n = this,
                r = this.options;
            this.opos = [t.pageX, t.pageY];
            if (this.options.disabled) return;
            this.selectees = e(r.filter, this.element[0]), this._trigger("start", t), e(r.appendTo).append(this.helper), this.helper.css({
                left: t.pageX,
                top: t.pageY,
                width: 0,
                height: 0
            }), r.autoRefresh && this.refresh(), this.selectees.filter(".ui-selected").each(function () {
                var r = e.data(this, "selectable-item");
                r.startselected = !0, !t.metaKey && !t.ctrlKey && (r.$element.removeClass("ui-selected"), r.selected = !1, r.$element.addClass("ui-unselecting"), r.unselecting = !0, n._trigger("unselecting", t, {
                    unselecting: r.element
                }))
            }), e(t.target).parents().addBack().each(function () {
                var r, i = e.data(this, "selectable-item");
                if (i) return r = !t.metaKey && !t.ctrlKey || !i.$element.hasClass("ui-selected"), i.$element.removeClass(r ? "ui-unselecting" : "ui-selected").addClass(r ? "ui-selecting" : "ui-unselecting"), i.unselecting = !r, i.selecting = r, i.selected = r, r ? n._trigger("selecting", t, {
                    selecting: i.element
                }) : n._trigger("unselecting", t, {
                    unselecting: i.element
                }), !1
            })
        },
        _mouseDrag: function (t) {
            this.dragged = !0;
            if (this.options.disabled) return;
            var n, r = this,
                i = this.options,
                s = this.opos[0],
                o = this.opos[1],
                u = t.pageX,
                a = t.pageY;
            return s > u && (n = u, u = s, s = n), o > a && (n = a, a = o, o = n), this.helper.css({
                left: s,
                top: o,
                width: u - s,
                height: a - o
            }), this.selectees.each(function () {
                var n = e.data(this, "selectable-item"),
                    f = !1;
                if (!n || n.element === r.element[0]) return;
                i.tolerance === "touch" ? f = !(n.left > u || n.right < s || n.top > a || n.bottom < o) : i.tolerance === "fit" && (f = n.left > s && n.right < u && n.top > o && n.bottom < a), f ? (n.selected && (n.$element.removeClass("ui-selected"), n.selected = !1), n.unselecting && (n.$element.removeClass("ui-unselecting"), n.unselecting = !1), n.selecting || (n.$element.addClass("ui-selecting"), n.selecting = !0, r._trigger("selecting", t, {
                    selecting: n.element
                }))) : (n.selecting && ((t.metaKey || t.ctrlKey) && n.startselected ? (n.$element.removeClass("ui-selecting"), n.selecting = !1, n.$element.addClass("ui-selected"), n.selected = !0) : (n.$element.removeClass("ui-selecting"), n.selecting = !1, n.startselected && (n.$element.addClass("ui-unselecting"), n.unselecting = !0), r._trigger("unselecting", t, {
                    unselecting: n.element
                }))), n.selected && !t.metaKey && !t.ctrlKey && !n.startselected && (n.$element.removeClass("ui-selected"), n.selected = !1, n.$element.addClass("ui-unselecting"), n.unselecting = !0, r._trigger("unselecting", t, {
                    unselecting: n.element
                })))
            }), !1
        },
        _mouseStop: function (t) {
            var n = this;
            return this.dragged = !1, e(".ui-unselecting", this.element[0]).each(function () {
                var r = e.data(this, "selectable-item");
                r.$element.removeClass("ui-unselecting"), r.unselecting = !1, r.startselected = !1, n._trigger("unselected", t, {
                    unselected: r.element
                })
            }), e(".ui-selecting", this.element[0]).each(function () {
                var r = e.data(this, "selectable-item");
                r.$element.removeClass("ui-selecting").addClass("ui-selected"), r.selecting = !1, r.selected = !0, r.startselected = !0, n._trigger("selected", t, {
                    selected: r.element
                })
            }), this._trigger("stop", t), this.helper.remove(), !1
        }
    })
}(jQuery),
function (e, t) {
    function n(e, t, n) {
        return e > t && e < t + n
    }

    function r(e) {
        return /left|right/.test(e.css("float")) || /inline|table-cell/.test(e.css("display"))
    }
    e.widget("ui.sortable", e.ui.mouse, {
        version: "1.10.2",
        widgetEventPrefix: "sort",
        ready: !1,
        options: {
            appendTo: "parent",
            axis: !1,
            connectWith: !1,
            containment: !1,
            cursor: "auto",
            cursorAt: !1,
            dropOnEmpty: !0,
            forcePlaceholderSize: !1,
            forceHelperSize: !1,
            grid: !1,
            handle: !1,
            helper: "original",
            items: "> *",
            opacity: !1,
            placeholder: !1,
            revert: !1,
            scroll: !0,
            scrollSensitivity: 20,
            scrollSpeed: 20,
            scope: "default",
            tolerance: "intersect",
            zIndex: 1e3,
            activate: null,
            beforeStop: null,
            change: null,
            deactivate: null,
            out: null,
            over: null,
            receive: null,
            remove: null,
            sort: null,
            start: null,
            stop: null,
            update: null
        },
        _create: function () {
            var e = this.options;
            this.containerCache = {}, this.element.addClass("ui-sortable"), this.refresh(), this.floating = this.items.length ? e.axis === "x" || r(this.items[0].item) : !1, this.offset = this.element.offset(), this._mouseInit(), this.ready = !0
        },
        _destroy: function () {
            this.element.removeClass("ui-sortable ui-sortable-disabled"), this._mouseDestroy();
            for (var e = this.items.length - 1; e >= 0; e--) this.items[e].item.removeData(this.widgetName + "-item");
            return this
        },
        _setOption: function (t, n) {
            t === "disabled" ? (this.options[t] = n, this.widget().toggleClass("ui-sortable-disabled", !! n)) : e.Widget.prototype._setOption.apply(this, arguments)
        },
        _mouseCapture: function (t, n) {
            var r = null,
                i = !1,
                s = this;
            if (this.reverting) return !1;
            if (this.options.disabled || this.options.type === "static") return !1;
            this._refreshItems(t), e(t.target).parents().each(function () {
                if (e.data(this, s.widgetName + "-item") === s) return r = e(this), !1
            }), e.data(t.target, s.widgetName + "-item") === s && (r = e(t.target));
            if (!r) return !1;
            if (this.options.handle && !n) {
                e(this.options.handle, r).find("*").addBack().each(function () {
                    this === t.target && (i = !0)
                });
                if (!i) return !1
            }
            return this.currentItem = r, this._removeCurrentsFromItems(), !0
        },
        _mouseStart: function (t, n, r) {
            var i, s, o = this.options;
            this.currentContainer = this, this.refreshPositions(), this.helper = this._createHelper(t), this._cacheHelperProportions(), this._cacheMargins(), this.scrollParent = this.helper.scrollParent(), this.offset = this.currentItem.offset(), this.offset = {
                top: this.offset.top - this.margins.top,
                left: this.offset.left - this.margins.left
            }, e.extend(this.offset, {
                click: {
                    left: t.pageX - this.offset.left,
                    top: t.pageY - this.offset.top
                },
                parent: this._getParentOffset(),
                relative: this._getRelativeOffset()
            }), this.helper.css("position", "absolute"), this.cssPosition = this.helper.css("position"), this.originalPosition = this._generatePosition(t), this.originalPageX = t.pageX, this.originalPageY = t.pageY, o.cursorAt && this._adjustOffsetFromHelper(o.cursorAt), this.domPosition = {
                prev: this.currentItem.prev()[0],
                parent: this.currentItem.parent()[0]
            }, this.helper[0] !== this.currentItem[0] && this.currentItem.hide(), this._createPlaceholder(), o.containment && this._setContainment(), o.cursor && o.cursor !== "auto" && (s = this.document.find("body"), this.storedCursor = s.css("cursor"), s.css("cursor", o.cursor), this.storedStylesheet = e("<style>*{ cursor: " + o.cursor + " !important; }</style>").appendTo(s)), o.opacity && (this.helper.css("opacity") && (this._storedOpacity = this.helper.css("opacity")), this.helper.css("opacity", o.opacity)), o.zIndex && (this.helper.css("zIndex") && (this._storedZIndex = this.helper.css("zIndex")), this.helper.css("zIndex", o.zIndex)), this.scrollParent[0] !== document && this.scrollParent[0].tagName !== "HTML" && (this.overflowOffset = this.scrollParent.offset()), this._trigger("start", t, this._uiHash()), this._preserveHelperProportions || this._cacheHelperProportions();
            if (!r)
                for (i = this.containers.length - 1; i >= 0; i--) this.containers[i]._trigger("activate", t, this._uiHash(this));
            return e.ui.ddmanager && (e.ui.ddmanager.current = this), e.ui.ddmanager && !o.dropBehaviour && e.ui.ddmanager.prepareOffsets(this, t), this.dragging = !0, this.helper.addClass("ui-sortable-helper"), this._mouseDrag(t), !0
        },
        _mouseDrag: function (t) {
            var n, r, i, s, o = this.options,
                u = !1;
            this.position = this._generatePosition(t), this.positionAbs = this._convertPositionTo("absolute"), this.lastPositionAbs || (this.lastPositionAbs = this.positionAbs), this.options.scroll && (this.scrollParent[0] !== document && this.scrollParent[0].tagName !== "HTML" ? (this.overflowOffset.top + this.scrollParent[0].offsetHeight - t.pageY < o.scrollSensitivity ? this.scrollParent[0].scrollTop = u = this.scrollParent[0].scrollTop + o.scrollSpeed : t.pageY - this.overflowOffset.top < o.scrollSensitivity && (this.scrollParent[0].scrollTop = u = this.scrollParent[0].scrollTop - o.scrollSpeed), this.overflowOffset.left + this.scrollParent[0].offsetWidth - t.pageX < o.scrollSensitivity ? this.scrollParent[0].scrollLeft = u = this.scrollParent[0].scrollLeft + o.scrollSpeed : t.pageX - this.overflowOffset.left < o.scrollSensitivity && (this.scrollParent[0].scrollLeft = u = this.scrollParent[0].scrollLeft - o.scrollSpeed)) : (t.pageY - e(document).scrollTop() < o.scrollSensitivity ? u = e(document).scrollTop(e(document).scrollTop() - o.scrollSpeed) : e(window).height() - (t.pageY - e(document).scrollTop()) < o.scrollSensitivity && (u = e(document).scrollTop(e(document).scrollTop() + o.scrollSpeed)), t.pageX - e(document).scrollLeft() < o.scrollSensitivity ? u = e(document).scrollLeft(e(document).scrollLeft() - o.scrollSpeed) : e(window).width() - (t.pageX - e(document).scrollLeft()) < o.scrollSensitivity && (u = e(document).scrollLeft(e(document).scrollLeft() + o.scrollSpeed))), u !== !1 && e.ui.ddmanager && !o.dropBehaviour && e.ui.ddmanager.prepareOffsets(this, t)), this.positionAbs = this._convertPositionTo("absolute");
            if (!this.options.axis || this.options.axis !== "y") this.helper[0].style.left = this.position.left + "px";
            if (!this.options.axis || this.options.axis !== "x") this.helper[0].style.top = this.position.top + "px";
            for (n = this.items.length - 1; n >= 0; n--) {
                r = this.items[n], i = r.item[0], s = this._intersectsWithPointer(r);
                if (!s) continue;
                if (r.instance !== this.currentContainer) continue;
                if (i !== this.currentItem[0] && this.placeholder[s === 1 ? "next" : "prev"]()[0] !== i && !e.contains(this.placeholder[0], i) && (this.options.type === "semi-dynamic" ? !e.contains(this.element[0], i) : !0)) {
                    this.direction = s === 1 ? "down" : "up";
                    if (this.options.tolerance !== "pointer" && !this._intersectsWithSides(r)) break;
                    this._rearrange(t, r), this._trigger("change", t, this._uiHash());
                    break
                }
            }
            return this._contactContainers(t), e.ui.ddmanager && e.ui.ddmanager.drag(this, t), this._trigger("sort", t, this._uiHash()), this.lastPositionAbs = this.positionAbs, !1
        },
        _mouseStop: function (t, n) {
            if (!t) return;
            e.ui.ddmanager && !this.options.dropBehaviour && e.ui.ddmanager.drop(this, t);
            if (this.options.revert) {
                var r = this,
                    i = this.placeholder.offset(),
                    s = this.options.axis,
                    o = {};
                if (!s || s === "x") o.left = i.left - this.offset.parent.left - this.margins.left + (this.offsetParent[0] === document.body ? 0 : this.offsetParent[0].scrollLeft);
                if (!s || s === "y") o.top = i.top - this.offset.parent.top - this.margins.top + (this.offsetParent[0] === document.body ? 0 : this.offsetParent[0].scrollTop);
                this.reverting = !0, e(this.helper).animate(o, parseInt(this.options.revert, 10) || 500, function () {
                    r._clear(t)
                })
            } else this._clear(t, n);
            return !1
        },
        cancel: function () {
            if (this.dragging) {
                this._mouseUp({
                    target: null
                }), this.options.helper === "original" ? this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper") : this.currentItem.show();
                for (var t = this.containers.length - 1; t >= 0; t--) this.containers[t]._trigger("deactivate", null, this._uiHash(this)), this.containers[t].containerCache.over && (this.containers[t]._trigger("out", null, this._uiHash(this)), this.containers[t].containerCache.over = 0)
            }
            return this.placeholder && (this.placeholder[0].parentNode && this.placeholder[0].parentNode.removeChild(this.placeholder[0]), this.options.helper !== "original" && this.helper && this.helper[0].parentNode && this.helper.remove(), e.extend(this, {
                helper: null,
                dragging: !1,
                reverting: !1,
                _noFinalSort: null
            }), this.domPosition.prev ? e(this.domPosition.prev).after(this.currentItem) : e(this.domPosition.parent).prepend(this.currentItem)), this
        },
        serialize: function (t) {
            var n = this._getItemsAsjQuery(t && t.connected),
                r = [];
            return t = t || {}, e(n).each(function () {
                var n = (e(t.item || this).attr(t.attribute || "id") || "").match(t.expression || /(.+)[\-=_](.+)/);
                n && r.push((t.key || n[1] + "[]") + "=" + (t.key && t.expression ? n[1] : n[2]))
            }), !r.length && t.key && r.push(t.key + "="), r.join("&")
        },
        toArray: function (t) {
            var n = this._getItemsAsjQuery(t && t.connected),
                r = [];
            return t = t || {}, n.each(function () {
                r.push(e(t.item || this).attr(t.attribute || "id") || "")
            }), r
        },
        _intersectsWith: function (e) {
            var t = this.positionAbs.left,
                n = t + this.helperProportions.width,
                r = this.positionAbs.top,
                i = r + this.helperProportions.height,
                s = e.left,
                o = s + e.width,
                u = e.top,
                a = u + e.height,
                f = this.offset.click.top,
                l = this.offset.click.left,
                c = r + f > u && r + f < a && t + l > s && t + l < o;
            return this.options.tolerance === "pointer" || this.options.forcePointerForContainers || this.options.tolerance !== "pointer" && this.helperProportions[this.floating ? "width" : "height"] > e[this.floating ? "width" : "height"] ? c : s < t + this.helperProportions.width / 2 && n - this.helperProportions.width / 2 < o && u < r + this.helperProportions.height / 2 && i - this.helperProportions.height / 2 < a
        },
        _intersectsWithPointer: function (e) {
            var t = this.options.axis === "x" || n(this.positionAbs.top + this.offset.click.top, e.top, e.height),
                r = this.options.axis === "y" || n(this.positionAbs.left + this.offset.click.left, e.left, e.width),
                i = t && r,
                s = this._getDragVerticalDirection(),
                o = this._getDragHorizontalDirection();
            return i ? this.floating ? o && o === "right" || s === "down" ? 2 : 1 : s && (s === "down" ? 2 : 1) : !1
        },
        _intersectsWithSides: function (e) {
            var t = n(this.positionAbs.top + this.offset.click.top, e.top + e.height / 2, e.height),
                r = n(this.positionAbs.left + this.offset.click.left, e.left + e.width / 2, e.width),
                i = this._getDragVerticalDirection(),
                s = this._getDragHorizontalDirection();
            return this.floating && s ? s === "right" && r || s === "left" && !r : i && (i === "down" && t || i === "up" && !t)
        },
        _getDragVerticalDirection: function () {
            var e = this.positionAbs.top - this.lastPositionAbs.top;
            return e !== 0 && (e > 0 ? "down" : "up")
        },
        _getDragHorizontalDirection: function () {
            var e = this.positionAbs.left - this.lastPositionAbs.left;
            return e !== 0 && (e > 0 ? "right" : "left")
        },
        refresh: function (e) {
            return this._refreshItems(e), this.refreshPositions(), this
        },
        _connectWith: function () {
            var e = this.options;
            return e.connectWith.constructor === String ? [e.connectWith] : e.connectWith
        },
        _getItemsAsjQuery: function (t) {
            var n, r, i, s, o = [],
                u = [],
                a = this._connectWith();
            if (a && t)
                for (n = a.length - 1; n >= 0; n--) {
                    i = e(a[n]);
                    for (r = i.length - 1; r >= 0; r--) s = e.data(i[r], this.widgetFullName), s && s !== this && !s.options.disabled && u.push([e.isFunction(s.options.items) ? s.options.items.call(s.element) : e(s.options.items, s.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"), s])
                }
            u.push([e.isFunction(this.options.items) ? this.options.items.call(this.element, null, {
                options: this.options,
                item: this.currentItem
            }) : e(this.options.items, this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"), this]);
            for (n = u.length - 1; n >= 0; n--) u[n][0].each(function () {
                o.push(this)
            });
            return e(o)
        },
        _removeCurrentsFromItems: function () {
            var t = this.currentItem.find(":data(" + this.widgetName + "-item)");
            this.items = e.grep(this.items, function (e) {
                for (var n = 0; n < t.length; n++)
                    if (t[n] === e.item[0]) return !1;
                return !0
            })
        },
        _refreshItems: function (t) {
            this.items = [], this.containers = [this];
            var n, r, i, s, o, u, a, f, l = this.items,
                c = [
                    [e.isFunction(this.options.items) ? this.options.items.call(this.element[0], t, {
                        item: this.currentItem
                    }) : e(this.options.items, this.element), this]
                ],
                h = this._connectWith();
            if (h && this.ready)
                for (n = h.length - 1; n >= 0; n--) {
                    i = e(h[n]);
                    for (r = i.length - 1; r >= 0; r--) s = e.data(i[r], this.widgetFullName), s && s !== this && !s.options.disabled && (c.push([e.isFunction(s.options.items) ? s.options.items.call(s.element[0], t, {
                        item: this.currentItem
                    }) : e(s.options.items, s.element), s]), this.containers.push(s))
                }
            for (n = c.length - 1; n >= 0; n--) {
                o = c[n][1], u = c[n][0];
                for (r = 0, f = u.length; r < f; r++) a = e(u[r]), a.data(this.widgetName + "-item", o), l.push({
                    item: a,
                    instance: o,
                    width: 0,
                    height: 0,
                    left: 0,
                    top: 0
                })
            }
        },
        refreshPositions: function (t) {
            this.offsetParent && this.helper && (this.offset.parent = this._getParentOffset());
            var n, r, i, s;
            for (n = this.items.length - 1; n >= 0; n--) {
                r = this.items[n];
                if (r.instance !== this.currentContainer && this.currentContainer && r.item[0] !== this.currentItem[0]) continue;
                i = this.options.toleranceElement ? e(this.options.toleranceElement, r.item) : r.item, t || (r.width = i.outerWidth(), r.height = i.outerHeight()), s = i.offset(), r.left = s.left, r.top = s.top
            }
            if (this.options.custom && this.options.custom.refreshContainers) this.options.custom.refreshContainers.call(this);
            else
                for (n = this.containers.length - 1; n >= 0; n--) s = this.containers[n].element.offset(), this.containers[n].containerCache.left = s.left, this.containers[n].containerCache.top = s.top, this.containers[n].containerCache.width = this.containers[n].element.outerWidth(), this.containers[n].containerCache.height = this.containers[n].element.outerHeight();
            return this
        },
        _createPlaceholder: function (t) {
            t = t || this;
            var n, r = t.options;
            if (!r.placeholder || r.placeholder.constructor === String) n = r.placeholder, r.placeholder = {
                element: function () {
                    var r = t.currentItem[0].nodeName.toLowerCase(),
                        i = e(t.document[0].createElement(r)).addClass(n || t.currentItem[0].className + " ui-sortable-placeholder").removeClass("ui-sortable-helper");
                    return r === "tr" ? i.append("<td colspan='99'>&#160;</td>") : r === "img" && i.attr("src", t.currentItem.attr("src")), n || i.css("visibility", "hidden"), i
                },
                update: function (e, i) {
                    if (n && !r.forcePlaceholderSize) return;
                    i.height() || i.height(t.currentItem.innerHeight() - parseInt(t.currentItem.css("paddingTop") || 0, 10) - parseInt(t.currentItem.css("paddingBottom") || 0, 10)), i.width() || i.width(t.currentItem.innerWidth() - parseInt(t.currentItem.css("paddingLeft") || 0, 10) - parseInt(t.currentItem.css("paddingRight") || 0, 10))
                }
            };
            t.placeholder = e(r.placeholder.element.call(t.element, t.currentItem)), t.currentItem.after(t.placeholder), r.placeholder.update(t, t.placeholder)
        },
        _contactContainers: function (t) {
            var i, s, o, u, a, f, l, c, h, p, d = null,
                v = null;
            for (i = this.containers.length - 1; i >= 0; i--) {
                if (e.contains(this.currentItem[0], this.containers[i].element[0])) continue;
                if (this._intersectsWith(this.containers[i].containerCache)) {
                    if (d && e.contains(this.containers[i].element[0], d.element[0])) continue;
                    d = this.containers[i], v = i
                } else this.containers[i].containerCache.over && (this.containers[i]._trigger("out", t, this._uiHash(this)), this.containers[i].containerCache.over = 0)
            }
            if (!d) return;
            if (this.containers.length === 1) this.containers[v].containerCache.over || (this.containers[v]._trigger("over", t, this._uiHash(this)), this.containers[v].containerCache.over = 1);
            else {
                o = 1e4, u = null, p = d.floating || r(this.currentItem), a = p ? "left" : "top", f = p ? "width" : "height", l = this.positionAbs[a] + this.offset.click[a];
                for (s = this.items.length - 1; s >= 0; s--) {
                    if (!e.contains(this.containers[v].element[0], this.items[s].item[0])) continue;
                    if (this.items[s].item[0] === this.currentItem[0]) continue;
                    if (p && !n(this.positionAbs.top + this.offset.click.top, this.items[s].top, this.items[s].height)) continue;
                    c = this.items[s].item.offset()[a], h = !1, Math.abs(c - l) > Math.abs(c + this.items[s][f] - l) && (h = !0, c += this.items[s][f]), Math.abs(c - l) < o && (o = Math.abs(c - l), u = this.items[s], this.direction = h ? "up" : "down")
                }
                if (!u && !this.options.dropOnEmpty) return;
                if (this.currentContainer === this.containers[v]) return;
                u ? this._rearrange(t, u, null, !0) : this._rearrange(t, null, this.containers[v].element, !0), this._trigger("change", t, this._uiHash()), this.containers[v]._trigger("change", t, this._uiHash(this)), this.currentContainer = this.containers[v], this.options.placeholder.update(this.currentContainer, this.placeholder), this.containers[v]._trigger("over", t, this._uiHash(this)), this.containers[v].containerCache.over = 1
            }
        },
        _createHelper: function (t) {
            var n = this.options,
                r = e.isFunction(n.helper) ? e(n.helper.apply(this.element[0], [t, this.currentItem])) : n.helper === "clone" ? this.currentItem.clone() : this.currentItem;
            return r.parents("body").length || e(n.appendTo !== "parent" ? n.appendTo : this.currentItem[0].parentNode)[0].appendChild(r[0]), r[0] === this.currentItem[0] && (this._storedCSS = {
                width: this.currentItem[0].style.width,
                height: this.currentItem[0].style.height,
                position: this.currentItem.css("position"),
                top: this.currentItem.css("top"),
                left: this.currentItem.css("left")
            }), (!r[0].style.width || n.forceHelperSize) && r.width(this.currentItem.width()), (!r[0].style.height || n.forceHelperSize) && r.height(this.currentItem.height()), r
        },
        _adjustOffsetFromHelper: function (t) {
            typeof t == "string" && (t = t.split(" ")), e.isArray(t) && (t = {
                left: +t[0],
                top: +t[1] || 0
            }), "left" in t && (this.offset.click.left = t.left + this.margins.left), "right" in t && (this.offset.click.left = this.helperProportions.width - t.right + this.margins.left), "top" in t && (this.offset.click.top = t.top + this.margins.top), "bottom" in t && (this.offset.click.top = this.helperProportions.height - t.bottom + this.margins.top)
        },
        _getParentOffset: function () {
            this.offsetParent = this.helper.offsetParent();
            var t = this.offsetParent.offset();
            this.cssPosition === "absolute" && this.scrollParent[0] !== document && e.contains(this.scrollParent[0], this.offsetParent[0]) && (t.left += this.scrollParent.scrollLeft(), t.top += this.scrollParent.scrollTop());
            if (this.offsetParent[0] === document.body || this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() === "html" && e.ui.ie) t = {
                top: 0,
                left: 0
            };
            return {
                top: t.top + (parseInt(this.offsetParent.css("borderTopWidth"), 10) || 0),
                left: t.left + (parseInt(this.offsetParent.css("borderLeftWidth"), 10) || 0)
            }
        },
        _getRelativeOffset: function () {
            if (this.cssPosition === "relative") {
                var e = this.currentItem.position();
                return {
                    top: e.top - (parseInt(this.helper.css("top"), 10) || 0) + this.scrollParent.scrollTop(),
                    left: e.left - (parseInt(this.helper.css("left"), 10) || 0) + this.scrollParent.scrollLeft()
                }
            }
            return {
                top: 0,
                left: 0
            }
        },
        _cacheMargins: function () {
            this.margins = {
                left: parseInt(this.currentItem.css("marginLeft"), 10) || 0,
                top: parseInt(this.currentItem.css("marginTop"), 10) || 0
            }
        },
        _cacheHelperProportions: function () {
            this.helperProportions = {
                width: this.helper.outerWidth(),
                height: this.helper.outerHeight()
            }
        },
        _setContainment: function () {
            var t, n, r, i = this.options;
            i.containment === "parent" && (i.containment = this.helper[0].parentNode);
            if (i.containment === "document" || i.containment === "window") this.containment = [0 - this.offset.relative.left - this.offset.parent.left, 0 - this.offset.relative.top - this.offset.parent.top, e(i.containment === "document" ? document : window).width() - this.helperProportions.width - this.margins.left, (e(i.containment === "document" ? document : window).height() || document.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top];
            /^(document|window|parent)$/.test(i.containment) || (t = e(i.containment)[0], n = e(i.containment).offset(), r = e(t).css("overflow") !== "hidden", this.containment = [n.left + (parseInt(e(t).css("borderLeftWidth"), 10) || 0) + (parseInt(e(t).css("paddingLeft"), 10) || 0) - this.margins.left, n.top + (parseInt(e(t).css("borderTopWidth"), 10) || 0) + (parseInt(e(t).css("paddingTop"), 10) || 0) - this.margins.top, n.left + (r ? Math.max(t.scrollWidth, t.offsetWidth) : t.offsetWidth) - (parseInt(e(t).css("borderLeftWidth"), 10) || 0) - (parseInt(e(t).css("paddingRight"), 10) || 0) - this.helperProportions.width - this.margins.left, n.top + (r ? Math.max(t.scrollHeight, t.offsetHeight) : t.offsetHeight) - (parseInt(e(t).css("borderTopWidth"), 10) || 0) - (parseInt(e(t).css("paddingBottom"), 10) || 0) - this.helperProportions.height - this.margins.top])
        },
        _convertPositionTo: function (t, n) {
            n || (n = this.position);
            var r = t === "absolute" ? 1 : -1,
                i = this.cssPosition !== "absolute" || this.scrollParent[0] !== document && !! e.contains(this.scrollParent[0], this.offsetParent[0]) ? this.scrollParent : this.offsetParent,
                s = /(html|body)/i.test(i[0].tagName);
            return {
                top: n.top + this.offset.relative.top * r + this.offset.parent.top * r - (this.cssPosition === "fixed" ? -this.scrollParent.scrollTop() : s ? 0 : i.scrollTop()) * r,
                left: n.left + this.offset.relative.left * r + this.offset.parent.left * r - (this.cssPosition === "fixed" ? -this.scrollParent.scrollLeft() : s ? 0 : i.scrollLeft()) * r
            }
        },
        _generatePosition: function (t) {
            var n, r, i = this.options,
                s = t.pageX,
                o = t.pageY,
                u = this.cssPosition !== "absolute" || this.scrollParent[0] !== document && !! e.contains(this.scrollParent[0], this.offsetParent[0]) ? this.scrollParent : this.offsetParent,
                a = /(html|body)/i.test(u[0].tagName);
            return this.cssPosition === "relative" && (this.scrollParent[0] === document || this.scrollParent[0] === this.offsetParent[0]) && (this.offset.relative = this._getRelativeOffset()), this.originalPosition && (this.containment && (t.pageX - this.offset.click.left < this.containment[0] && (s = this.containment[0] + this.offset.click.left), t.pageY - this.offset.click.top < this.containment[1] && (o = this.containment[1] + this.offset.click.top), t.pageX - this.offset.click.left > this.containment[2] && (s = this.containment[2] + this.offset.click.left), t.pageY - this.offset.click.top > this.containment[3] && (o = this.containment[3] + this.offset.click.top)), i.grid && (n = this.originalPageY + Math.round((o - this.originalPageY) / i.grid[1]) * i.grid[1], o = this.containment ? n - this.offset.click.top >= this.containment[1] && n - this.offset.click.top <= this.containment[3] ? n : n - this.offset.click.top >= this.containment[1] ? n - i.grid[1] : n + i.grid[1] : n, r = this.originalPageX + Math.round((s - this.originalPageX) / i.grid[0]) * i.grid[0], s = this.containment ? r - this.offset.click.left >= this.containment[0] && r - this.offset.click.left <= this.containment[2] ? r : r - this.offset.click.left >= this.containment[0] ? r - i.grid[0] : r + i.grid[0] : r)), {
                top: o - this.offset.click.top - this.offset.relative.top - this.offset.parent.top + (this.cssPosition === "fixed" ? -this.scrollParent.scrollTop() : a ? 0 : u.scrollTop()),
                left: s - this.offset.click.left - this.offset.relative.left - this.offset.parent.left + (this.cssPosition === "fixed" ? -this.scrollParent.scrollLeft() : a ? 0 : u.scrollLeft())
            }
        },
        _rearrange: function (e, t, n, r) {
            n ? n[0].appendChild(this.placeholder[0]) : t.item[0].parentNode.insertBefore(this.placeholder[0], this.direction === "down" ? t.item[0] : t.item[0].nextSibling), this.counter = this.counter ? ++this.counter : 1;
            var i = this.counter;
            this._delay(function () {
                i === this.counter && this.refreshPositions(!r)
            })
        },
        _clear: function (e, t) {
            this.reverting = !1;
            var n, r = [];
            !this._noFinalSort && this.currentItem.parent().length && this.placeholder.before(this.currentItem), this._noFinalSort = null;
            if (this.helper[0] === this.currentItem[0]) {
                for (n in this._storedCSS)
                    if (this._storedCSS[n] === "auto" || this._storedCSS[n] === "static") this._storedCSS[n] = "";
                this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")
            } else this.currentItem.show();
            this.fromOutside && !t && r.push(function (e) {
                this._trigger("receive", e, this._uiHash(this.fromOutside))
            }), (this.fromOutside || this.domPosition.prev !== this.currentItem.prev().not(".ui-sortable-helper")[0] || this.domPosition.parent !== this.currentItem.parent()[0]) && !t && r.push(function (e) {
                this._trigger("update", e, this._uiHash())
            }), this !== this.currentContainer && (t || (r.push(function (e) {
                this._trigger("remove", e, this._uiHash())
            }), r.push(function (e) {
                return function (t) {
                    e._trigger("receive", t, this._uiHash(this))
                }
            }.call(this, this.currentContainer)), r.push(function (e) {
                return function (t) {
                    e._trigger("update", t, this._uiHash(this))
                }
            }.call(this, this.currentContainer))));
            for (n = this.containers.length - 1; n >= 0; n--) t || r.push(function (e) {
                return function (t) {
                    e._trigger("deactivate", t, this._uiHash(this))
                }
            }.call(this, this.containers[n])), this.containers[n].containerCache.over && (r.push(function (e) {
                return function (t) {
                    e._trigger("out", t, this._uiHash(this))
                }
            }.call(this, this.containers[n])), this.containers[n].containerCache.over = 0);
            this.storedCursor && (this.document.find("body").css("cursor", this.storedCursor), this.storedStylesheet.remove()), this._storedOpacity && this.helper.css("opacity", this._storedOpacity), this._storedZIndex && this.helper.css("zIndex", this._storedZIndex === "auto" ? "" : this._storedZIndex), this.dragging = !1;
            if (this.cancelHelperRemoval) {
                if (!t) {
                    this._trigger("beforeStop", e, this._uiHash());
                    for (n = 0; n < r.length; n++) r[n].call(this, e);
                    this._trigger("stop", e, this._uiHash())
                }
                return this.fromOutside = !1, !1
            }
            t || this._trigger("beforeStop", e, this._uiHash()), this.placeholder[0].parentNode.removeChild(this.placeholder[0]), this.helper[0] !== this.currentItem[0] && this.helper.remove(), this.helper = null;
            if (!t) {
                for (n = 0; n < r.length; n++) r[n].call(this, e);
                this._trigger("stop", e, this._uiHash())
            }
            return this.fromOutside = !1, !0
        },
        _trigger: function () {
            e.Widget.prototype._trigger.apply(this, arguments) === !1 && this.cancel()
        },
        _uiHash: function (t) {
            var n = t || this;
            return {
                helper: n.helper,
                placeholder: n.placeholder || e([]),
                position: n.position,
                originalPosition: n.originalPosition,
                offset: n.positionAbs,
                item: n.currentItem,
                sender: t ? t.element : null
            }
        }
    })
}(jQuery),
function (e, t) {
    var n = 0,
        r = {}, i = {};
    r.height = r.paddingTop = r.paddingBottom = r.borderTopWidth = r.borderBottomWidth = "hide", i.height = i.paddingTop = i.paddingBottom = i.borderTopWidth = i.borderBottomWidth = "show", e.widget("ui.accordion", {
        version: "1.10.2",
        options: {
            active: 0,
            animate: {},
            collapsible: !1,
            event: "click",
            header: "> li > :first-child,> :not(li):even",
            heightStyle: "auto",
            icons: {
                activeHeader: "ui-icon-triangle-1-s",
                header: "ui-icon-triangle-1-e"
            },
            activate: null,
            beforeActivate: null
        },
        _create: function () {
            var t = this.options;
            this.prevShow = this.prevHide = e(), this.element.addClass("ui-accordion ui-widget ui-helper-reset").attr("role", "tablist"), !t.collapsible && (t.active === !1 || t.active == null) && (t.active = 0), this._processPanels(), t.active < 0 && (t.active += this.headers.length), this._refresh()
        },
        _getCreateEventData: function () {
            return {
                header: this.active,
                panel: this.active.length ? this.active.next() : e(),
                content: this.active.length ? this.active.next() : e()
            }
        },
        _createIcons: function () {
            var t = this.options.icons;
            t && (e("<span>").addClass("ui-accordion-header-icon ui-icon " + t.header).prependTo(this.headers), this.active.children(".ui-accordion-header-icon").removeClass(t.header).addClass(t.activeHeader), this.headers.addClass("ui-accordion-icons"))
        },
        _destroyIcons: function () {
            this.headers.removeClass("ui-accordion-icons").children(".ui-accordion-header-icon").remove()
        },
        _destroy: function () {
            var e;
            this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role"), this.headers.removeClass("ui-accordion-header ui-accordion-header-active ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-selected").removeAttr("aria-controls").removeAttr("tabIndex").each(function () {
                /^ui-accordion/.test(this.id) && this.removeAttribute("id")
            }), this._destroyIcons(), e = this.headers.next().css("display", "").removeAttr("role").removeAttr("aria-expanded").removeAttr("aria-hidden").removeAttr("aria-labelledby").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-state-disabled").each(function () {
                /^ui-accordion/.test(this.id) && this.removeAttribute("id")
            }), this.options.heightStyle !== "content" && e.css("height", "")
        },
        _setOption: function (e, t) {
            if (e === "active") {
                this._activate(t);
                return
            }
            e === "event" && (this.options.event && this._off(this.headers, this.options.event), this._setupEvents(t)), this._super(e, t), e === "collapsible" && !t && this.options.active === !1 && this._activate(0), e === "icons" && (this._destroyIcons(), t && this._createIcons()), e === "disabled" && this.headers.add(this.headers.next()).toggleClass("ui-state-disabled", !! t)
        },
        _keydown: function (t) {
            if (t.altKey || t.ctrlKey) return;
            var n = e.ui.keyCode,
                r = this.headers.length,
                i = this.headers.index(t.target),
                s = !1;
            switch (t.keyCode) {
            case n.RIGHT:
            case n.DOWN:
                s = this.headers[(i + 1) % r];
                break;
            case n.LEFT:
            case n.UP:
                s = this.headers[(i - 1 + r) % r];
                break;
            case n.SPACE:
            case n.ENTER:
                this._eventHandler(t);
                break;
            case n.HOME:
                s = this.headers[0];
                break;
            case n.END:
                s = this.headers[r - 1]
            }
            s && (e(t.target).attr("tabIndex", -1), e(s).attr("tabIndex", 0), s.focus(), t.preventDefault())
        },
        _panelKeyDown: function (t) {
            t.keyCode === e.ui.keyCode.UP && t.ctrlKey && e(t.currentTarget).prev().focus()
        },
        refresh: function () {
            var t = this.options;
            this._processPanels();
            if (t.active === !1 && t.collapsible === !0 || !this.headers.length) t.active = !1, this.active = e();
            t.active === !1 ? this._activate(0) : this.active.length && !e.contains(this.element[0], this.active[0]) ? this.headers.length === this.headers.find(".ui-state-disabled").length ? (t.active = !1, this.active = e()) : this._activate(Math.max(0, t.active - 1)) : t.active = this.headers.index(this.active), this._destroyIcons(), this._refresh()
        },
        _processPanels: function () {
            this.headers = this.element.find(this.options.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all"), this.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom").filter(":not(.ui-accordion-content-active)").hide()
        },
        _refresh: function () {
            var t, r = this.options,
                i = r.heightStyle,
                s = this.element.parent(),
                o = this.accordionId = "ui-accordion-" + (this.element.attr("id") || ++n);
            this.active = this._findActive(r.active).addClass("ui-accordion-header-active ui-state-active ui-corner-top").removeClass("ui-corner-all"), this.active.next().addClass("ui-accordion-content-active").show(), this.headers.attr("role", "tab").each(function (t) {
                var n = e(this),
                    r = n.attr("id"),
                    i = n.next(),
                    s = i.attr("id");
                r || (r = o + "-header-" + t, n.attr("id", r)), s || (s = o + "-panel-" + t, i.attr("id", s)), n.attr("aria-controls", s), i.attr("aria-labelledby", r)
            }).next().attr("role", "tabpanel"), this.headers.not(this.active).attr({
                "aria-selected": "false",
                tabIndex: -1
            }).next().attr({
                "aria-expanded": "false",
                "aria-hidden": "true"
            }).hide(), this.active.length ? this.active.attr({
                "aria-selected": "true",
                tabIndex: 0
            }).next().attr({
                "aria-expanded": "true",
                "aria-hidden": "false"
            }) : this.headers.eq(0).attr("tabIndex", 0), this._createIcons(), this._setupEvents(r.event), i === "fill" ? (t = s.height(), this.element.siblings(":visible").each(function () {
                var n = e(this),
                    r = n.css("position");
                if (r === "absolute" || r === "fixed") return;
                t -= n.outerHeight(!0)
            }), this.headers.each(function () {
                t -= e(this).outerHeight(!0)
            }), this.headers.next().each(function () {
                e(this).height(Math.max(0, t - e(this).innerHeight() + e(this).height()))
            }).css("overflow", "auto")) : i === "auto" && (t = 0, this.headers.next().each(function () {
                t = Math.max(t, e(this).css("height", "").height())
            }).height(t))
        },
        _activate: function (t) {
            var n = this._findActive(t)[0];
            if (n === this.active[0]) return;
            n = n || this.active[0], this._eventHandler({
                target: n,
                currentTarget: n,
                preventDefault: e.noop
            })
        },
        _findActive: function (t) {
            return typeof t == "number" ? this.headers.eq(t) : e()
        },
        _setupEvents: function (t) {
            var n = {
                keydown: "_keydown"
            };
            t && e.each(t.split(" "), function (e, t) {
                n[t] = "_eventHandler"
            }), this._off(this.headers.add(this.headers.next())), this._on(this.headers, n), this._on(this.headers.next(), {
                keydown: "_panelKeyDown"
            }), this._hoverable(this.headers), this._focusable(this.headers)
        },
        _eventHandler: function (t) {
            var n = this.options,
                r = this.active,
                i = e(t.currentTarget),
                s = i[0] === r[0],
                o = s && n.collapsible,
                u = o ? e() : i.next(),
                a = r.next(),
                f = {
                    oldHeader: r,
                    oldPanel: a,
                    newHeader: o ? e() : i,
                    newPanel: u
                };
            t.preventDefault();
            if (s && !n.collapsible || this._trigger("beforeActivate", t, f) === !1) return;
            n.active = o ? !1 : this.headers.index(i), this.active = s ? e() : i, this._toggle(f), r.removeClass("ui-accordion-header-active ui-state-active"), n.icons && r.children(".ui-accordion-header-icon").removeClass(n.icons.activeHeader).addClass(n.icons.header), s || (i.removeClass("ui-corner-all").addClass("ui-accordion-header-active ui-state-active ui-corner-top"), n.icons && i.children(".ui-accordion-header-icon").removeClass(n.icons.header).addClass(n.icons.activeHeader), i.next().addClass("ui-accordion-content-active"))
        },
        _toggle: function (t) {
            var n = t.newPanel,
                r = this.prevShow.length ? this.prevShow : t.oldPanel;
            this.prevShow.add(this.prevHide).stop(!0, !0), this.prevShow = n, this.prevHide = r, this.options.animate ? this._animate(n, r, t) : (r.hide(), n.show(), this._toggleComplete(t)), r.attr({
                "aria-expanded": "false",
                "aria-hidden": "true"
            }), r.prev().attr("aria-selected", "false"), n.length && r.length ? r.prev().attr("tabIndex", -1) : n.length && this.headers.filter(function () {
                return e(this).attr("tabIndex") === 0
            }).attr("tabIndex", -1), n.attr({
                "aria-expanded": "true",
                "aria-hidden": "false"
            }).prev().attr({
                "aria-selected": "true",
                tabIndex: 0
            })
        },
        _animate: function (e, t, n) {
            var s, o, u, a = this,
                f = 0,
                l = e.length && (!t.length || e.index() < t.index()),
                c = this.options.animate || {}, h = l && c.down || c,
                p = function () {
                    a._toggleComplete(n)
                };
            typeof h == "number" && (u = h), typeof h == "string" && (o = h), o = o || h.easing || c.easing, u = u || h.duration || c.duration;
            if (!t.length) return e.animate(i, u, o, p);
            if (!e.length) return t.animate(r, u, o, p);
            s = e.show().outerHeight(), t.animate(r, {
                duration: u,
                easing: o,
                step: function (e, t) {
                    t.now = Math.round(e)
                }
            }), e.hide().animate(i, {
                duration: u,
                easing: o,
                complete: p,
                step: function (e, n) {
                    n.now = Math.round(e), n.prop !== "height" ? f += n.now : a.options.heightStyle !== "content" && (n.now = Math.round(s - t.outerHeight() - f), f = 0)
                }
            })
        },
        _toggleComplete: function (e) {
            var t = e.oldPanel;
            t.removeClass("ui-accordion-content-active").prev().removeClass("ui-corner-top").addClass("ui-corner-all"), t.length && (t.parent()[0].className = t.parent()[0].className), this._trigger("activate", null, e)
        }
    })
}(jQuery),
function (e, t) {
    var n = 0;
    e.widget("ui.autocomplete", {
        version: "1.10.2",
        defaultElement: "<input>",
        options: {
            appendTo: null,
            autoFocus: !1,
            delay: 300,
            minLength: 1,
            position: {
                my: "left top",
                at: "left bottom",
                collision: "none"
            },
            source: null,
            change: null,
            close: null,
            focus: null,
            open: null,
            response: null,
            search: null,
            select: null
        },
        pending: 0,
        _create: function () {
            var t, n, r, i = this.element[0].nodeName.toLowerCase(),
                s = i === "textarea",
                o = i === "input";
            this.isMultiLine = s ? !0 : o ? !1 : this.element.prop("isContentEditable"), this.valueMethod = this.element[s || o ? "val" : "text"], this.isNewMenu = !0, this.element.addClass("ui-autocomplete-input").attr("autocomplete", "off"), this._on(this.element, {
                keydown: function (i) {
                    if (this.element.prop("readOnly")) {
                        t = !0, r = !0, n = !0;
                        return
                    }
                    t = !1, r = !1, n = !1;
                    var s = e.ui.keyCode;
                    switch (i.keyCode) {
                    case s.PAGE_UP:
                        t = !0, this._move("previousPage", i);
                        break;
                    case s.PAGE_DOWN:
                        t = !0, this._move("nextPage", i);
                        break;
                    case s.UP:
                        t = !0, this._keyEvent("previous", i);
                        break;
                    case s.DOWN:
                        t = !0, this._keyEvent("next", i);
                        break;
                    case s.ENTER:
                    case s.NUMPAD_ENTER:
                        this.menu.active && (t = !0, i.preventDefault(), this.menu.select(i));
                        break;
                    case s.TAB:
                        this.menu.active && this.menu.select(i);
                        break;
                    case s.ESCAPE:
                        this.menu.element.is(":visible") && (this._value(this.term), this.close(i), i.preventDefault());
                        break;
                    default:
                        n = !0, this._searchTimeout(i)
                    }
                },
                keypress: function (r) {
                    if (t) {
                        t = !1, r.preventDefault();
                        return
                    }
                    if (n) return;
                    var i = e.ui.keyCode;
                    switch (r.keyCode) {
                    case i.PAGE_UP:
                        this._move("previousPage", r);
                        break;
                    case i.PAGE_DOWN:
                        this._move("nextPage", r);
                        break;
                    case i.UP:
                        this._keyEvent("previous", r);
                        break;
                    case i.DOWN:
                        this._keyEvent("next", r)
                    }
                },
                input: function (e) {
                    if (r) {
                        r = !1, e.preventDefault();
                        return
                    }
                    this._searchTimeout(e)
                },
                focus: function () {
                    this.selectedItem = null, this.previous = this._value()
                },
                blur: function (e) {
                    if (this.cancelBlur) {
                        delete this.cancelBlur;
                        return
                    }
                    clearTimeout(this.searching), this.close(e), this._change(e)
                }
            }), this._initSource(), this.menu = e("<ul>").addClass("ui-autocomplete ui-front").appendTo(this._appendTo()).menu({
                input: e(),
                role: null
            }).hide().data("ui-menu"), this._on(this.menu.element, {
                mousedown: function (t) {
                    t.preventDefault(), this.cancelBlur = !0, this._delay(function () {
                        delete this.cancelBlur
                    });
                    var n = this.menu.element[0];
                    e(t.target).closest(".ui-menu-item").length || this._delay(function () {
                        var t = this;
                        this.document.one("mousedown", function (r) {
                            r.target !== t.element[0] && r.target !== n && !e.contains(n, r.target) && t.close()
                        })
                    })
                },
                menufocus: function (t, n) {
                    if (this.isNewMenu) {
                        this.isNewMenu = !1;
                        if (t.originalEvent && /^mouse/.test(t.originalEvent.type)) {
                            this.menu.blur(), this.document.one("mousemove", function () {
                                e(t.target).trigger(t.originalEvent)
                            });
                            return
                        }
                    }
                    var r = n.item.data("ui-autocomplete-item");
                    !1 !== this._trigger("focus", t, {
                        item: r
                    }) ? t.originalEvent && /^key/.test(t.originalEvent.type) && this._value(r.value) : this.liveRegion.text(r.value)
                },
                menuselect: function (e, t) {
                    var n = t.item.data("ui-autocomplete-item"),
                        r = this.previous;
                    this.element[0] !== this.document[0].activeElement && (this.element.focus(), this.previous = r, this._delay(function () {
                        this.previous = r, this.selectedItem = n
                    })), !1 !== this._trigger("select", e, {
                        item: n
                    }) && this._value(n.value), this.term = this._value(), this.close(e), this.selectedItem = n
                }
            }), this.liveRegion = e("<span>", {
                role: "status",
                "aria-live": "polite"
            }).addClass("ui-helper-hidden-accessible").insertAfter(this.element), this._on(this.window, {
                beforeunload: function () {
                    this.element.removeAttr("autocomplete")
                }
            })
        },
        _destroy: function () {
            clearTimeout(this.searching), this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete"), this.menu.element.remove(), this.liveRegion.remove()
        },
        _setOption: function (e, t) {
            this._super(e, t), e === "source" && this._initSource(), e === "appendTo" && this.menu.element.appendTo(this._appendTo()), e === "disabled" && t && this.xhr && this.xhr.abort()
        },
        _appendTo: function () {
            var t = this.options.appendTo;
            return t && (t = t.jquery || t.nodeType ? e(t) : this.document.find(t).eq(0)), t || (t = this.element.closest(".ui-front")), t.length || (t = this.document[0].body), t
        },
        _initSource: function () {
            var t, n, r = this;
            e.isArray(this.options.source) ? (t = this.options.source, this.source = function (n, r) {
                r(e.ui.autocomplete.filter(t, n.term))
            }) : typeof this.options.source == "string" ? (n = this.options.source, this.source = function (t, i) {
                r.xhr && r.xhr.abort(), r.xhr = e.ajax({
                    url: n,
                    data: t,
                    dataType: "json",
                    success: function (e) {
                        i(e)
                    },
                    error: function () {
                        i([])
                    }
                })
            }) : this.source = this.options.source
        },
        _searchTimeout: function (e) {
            clearTimeout(this.searching), this.searching = this._delay(function () {
                this.term !== this._value() && (this.selectedItem = null, this.search(null, e))
            }, this.options.delay)
        },
        search: function (e, t) {
            e = e != null ? e : this._value(), this.term = this._value();
            if (e.length < this.options.minLength) return this.close(t);
            if (this._trigger("search", t) === !1) return;
            return this._search(e)
        },
        _search: function (e) {
            this.pending++, this.element.addClass("ui-autocomplete-loading"), this.cancelSearch = !1, this.source({
                term: e
            }, this._response())
        },
        _response: function () {
            var e = this,
                t = ++n;
            return function (r) {
                t === n && e.__response(r), e.pending--, e.pending || e.element.removeClass("ui-autocomplete-loading")
            }
        },
        __response: function (e) {
            e && (e = this._normalize(e)), this._trigger("response", null, {
                content: e
            }), !this.options.disabled && e && e.length && !this.cancelSearch ? (this._suggest(e), this._trigger("open")) : this._close()
        },
        close: function (e) {
            this.cancelSearch = !0, this._close(e)
        },
        _close: function (e) {
            this.menu.element.is(":visible") && (this.menu.element.hide(), this.menu.blur(), this.isNewMenu = !0, this._trigger("close", e))
        },
        _change: function (e) {
            this.previous !== this._value() && this._trigger("change", e, {
                item: this.selectedItem
            })
        },
        _normalize: function (t) {
            return t.length && t[0].label && t[0].value ? t : e.map(t, function (t) {
                return typeof t == "string" ? {
                    label: t,
                    value: t
                } : e.extend({
                    label: t.label || t.value,
                    value: t.value || t.label
                }, t)
            })
        },
        _suggest: function (t) {
            var n = this.menu.element.empty();
            this._renderMenu(n, t), this.isNewMenu = !0, this.menu.refresh(), n.show(), this._resizeMenu(), n.position(e.extend({
                of: this.element
            }, this.options.position)), this.options.autoFocus && this.menu.next()
        },
        _resizeMenu: function () {
            var e = this.menu.element;
            e.outerWidth(Math.max(e.width("").outerWidth() + 1, this.element.outerWidth()))
        },
        _renderMenu: function (t, n) {
            var r = this;
            e.each(n, function (e, n) {
                r._renderItemData(t, n)
            })
        },
        _renderItemData: function (e, t) {
            return this._renderItem(e, t).data("ui-autocomplete-item", t)
        },
        _renderItem: function (t, n) {
            return e("<li>").append(e("<a>").text(n.label)).appendTo(t)
        },
        _move: function (e, t) {
            if (!this.menu.element.is(":visible")) {
                this.search(null, t);
                return
            }
            if (this.menu.isFirstItem() && /^previous/.test(e) || this.menu.isLastItem() && /^next/.test(e)) {
                this._value(this.term), this.menu.blur();
                return
            }
            this.menu[e](t)
        },
        widget: function () {
            return this.menu.element
        },
        _value: function () {
            return this.valueMethod.apply(this.element, arguments)
        },
        _keyEvent: function (e, t) {
            if (!this.isMultiLine || this.menu.element.is(":visible")) this._move(e, t), t.preventDefault()
        }
    }), e.extend(e.ui.autocomplete, {
        escapeRegex: function (e) {
            return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&")
        },
        filter: function (t, n) {
            var r = new RegExp(e.ui.autocomplete.escapeRegex(n), "i");
            return e.grep(t, function (e) {
                return r.test(e.label || e.value || e)
            })
        }
    }), e.widget("ui.autocomplete", e.ui.autocomplete, {
        options: {
            messages: {
                noResults: "No search results.",
                results: function (e) {
                    return e + (e > 1 ? " results are" : " result is") + " available, use up and down arrow keys to navigate."
                }
            }
        },
        __response: function (e) {
            var t;
            this._superApply(arguments);
            if (this.options.disabled || this.cancelSearch) return;
            e && e.length ? t = this.options.messages.results(e.length) : t = this.options.messages.noResults, this.liveRegion.text(t)
        }
    })
}(jQuery),
function (e, t) {
    var n, r, i, s, o = "ui-button ui-widget ui-state-default ui-corner-all",
        u = "ui-state-hover ui-state-active ",
        a = "ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only",
        f = function () {
            var t = e(this).find(":ui-button");
            setTimeout(function () {
                t.button("refresh")
            }, 1)
        }, l = function (t) {
            var n = t.name,
                r = t.form,
                i = e([]);
            return n && (n = n.replace(/'/g, "\\'"), r ? i = e(r).find("[name='" + n + "']") : i = e("[name='" + n + "']", t.ownerDocument).filter(function () {
                return !this.form
            })), i
        };
    e.widget("ui.button", {
        version: "1.10.2",
        defaultElement: "<button>",
        options: {
            disabled: null,
            text: !0,
            label: null,
            icons: {
                primary: null,
                secondary: null
            }
        },
        _create: function () {
            this.element.closest("form").unbind("reset" + this.eventNamespace).bind("reset" + this.eventNamespace, f), typeof this.options.disabled != "boolean" ? this.options.disabled = !! this.element.prop("disabled") : this.element.prop("disabled", this.options.disabled), this._determineButtonType(), this.hasTitle = !! this.buttonElement.attr("title");
            var t = this,
                u = this.options,
                a = this.type === "checkbox" || this.type === "radio",
                c = a ? "" : "ui-state-active",
                h = "ui-state-focus";
            u.label === null && (u.label = this.type === "input" ? this.buttonElement.val() : this.buttonElement.html()), this._hoverable(this.buttonElement), this.buttonElement.addClass(o).attr("role", "button").bind("mouseenter" + this.eventNamespace, function () {
                if (u.disabled) return;
                this === n && e(this).addClass("ui-state-active")
            }).bind("mouseleave" + this.eventNamespace, function () {
                if (u.disabled) return;
                e(this).removeClass(c)
            }).bind("click" + this.eventNamespace, function (e) {
                u.disabled && (e.preventDefault(), e.stopImmediatePropagation())
            }), this.element.bind("focus" + this.eventNamespace, function () {
                t.buttonElement.addClass(h)
            }).bind("blur" + this.eventNamespace, function () {
                t.buttonElement.removeClass(h)
            }), a && (this.element.bind("change" + this.eventNamespace, function () {
                if (s) return;
                t.refresh()
            }), this.buttonElement.bind("mousedown" + this.eventNamespace, function (e) {
                if (u.disabled) return;
                s = !1, r = e.pageX, i = e.pageY
            }).bind("mouseup" + this.eventNamespace, function (e) {
                if (u.disabled) return;
                if (r !== e.pageX || i !== e.pageY) s = !0
            })), this.type === "checkbox" ? this.buttonElement.bind("click" + this.eventNamespace, function () {
                if (u.disabled || s) return !1
            }) : this.type === "radio" ? this.buttonElement.bind("click" + this.eventNamespace, function () {
                if (u.disabled || s) return !1;
                e(this).addClass("ui-state-active"), t.buttonElement.attr("aria-pressed", "true");
                var n = t.element[0];
                l(n).not(n).map(function () {
                    return e(this).button("widget")[0]
                }).removeClass("ui-state-active").attr("aria-pressed", "false")
            }) : (this.buttonElement.bind("mousedown" + this.eventNamespace, function () {
                if (u.disabled) return !1;
                e(this).addClass("ui-state-active"), n = this, t.document.one("mouseup", function () {
                    n = null
                })
            }).bind("mouseup" + this.eventNamespace, function () {
                if (u.disabled) return !1;
                e(this).removeClass("ui-state-active")
            }).bind("keydown" + this.eventNamespace, function (t) {
                if (u.disabled) return !1;
                (t.keyCode === e.ui.keyCode.SPACE || t.keyCode === e.ui.keyCode.ENTER) && e(this).addClass("ui-state-active")
            }).bind("keyup" + this.eventNamespace + " blur" + this.eventNamespace, function () {
                e(this).removeClass("ui-state-active")
            }), this.buttonElement.is("a") && this.buttonElement.keyup(function (t) {
                t.keyCode === e.ui.keyCode.SPACE && e(this).click()
            })), this._setOption("disabled", u.disabled), this._resetButton()
        },
        _determineButtonType: function () {
            var e, t, n;
            this.element.is("[type=checkbox]") ? this.type = "checkbox" : this.element.is("[type=radio]") ? this.type = "radio" : this.element.is("input") ? this.type = "input" : this.type = "button", this.type === "checkbox" || this.type === "radio" ? (e = this.element.parents().last(), t = "label[for='" + this.element.attr("id") + "']", this.buttonElement = e.find(t), this.buttonElement.length || (e = e.length ? e.siblings() : this.element.siblings(), this.buttonElement = e.filter(t), this.buttonElement.length || (this.buttonElement = e.find(t))), this.element.addClass("ui-helper-hidden-accessible"), n = this.element.is(":checked"), n && this.buttonElement.addClass("ui-state-active"), this.buttonElement.prop("aria-pressed", n)) : this.buttonElement = this.element
        },
        widget: function () {
            return this.buttonElement
        },
        _destroy: function () {
            this.element.removeClass("ui-helper-hidden-accessible"), this.buttonElement.removeClass(o + " " + u + " " + a).removeAttr("role").removeAttr("aria-pressed").html(this.buttonElement.find(".ui-button-text").html()), this.hasTitle || this.buttonElement.removeAttr("title")
        },
        _setOption: function (e, t) {
            this._super(e, t);
            if (e === "disabled") {
                t ? this.element.prop("disabled", !0) : this.element.prop("disabled", !1);
                return
            }
            this._resetButton()
        },
        refresh: function () {
            var t = this.element.is("input, button") ? this.element.is(":disabled") : this.element.hasClass("ui-button-disabled");
            t !== this.options.disabled && this._setOption("disabled", t), this.type === "radio" ? l(this.element[0]).each(function () {
                e(this).is(":checked") ? e(this).button("widget").addClass("ui-state-active").attr("aria-pressed", "true") : e(this).button("widget").removeClass("ui-state-active").attr("aria-pressed", "false")
            }) : this.type === "checkbox" && (this.element.is(":checked") ? this.buttonElement.addClass("ui-state-active").attr("aria-pressed", "true") : this.buttonElement.removeClass("ui-state-active").attr("aria-pressed", "false"))
        },
        _resetButton: function () {
            if (this.type === "input") {
                this.options.label && this.element.val(this.options.label);
                return
            }
            var t = this.buttonElement.removeClass(a),
                n = e("<span></span>", this.document[0]).addClass("ui-button-text").html(this.options.label).appendTo(t.empty()).text(),
                r = this.options.icons,
                i = r.primary && r.secondary,
                s = [];
            r.primary || r.secondary ? (this.options.text && s.push("ui-button-text-icon" + (i ? "s" : r.primary ? "-primary" : "-secondary")), r.primary && t.prepend("<span class='ui-button-icon-primary ui-icon " + r.primary + "'></span>"), r.secondary && t.append("<span class='ui-button-icon-secondary ui-icon " + r.secondary + "'></span>"), this.options.text || (s.push(i ? "ui-button-icons-only" : "ui-button-icon-only"), this.hasTitle || t.attr("title", e.trim(n)))) : s.push("ui-button-text-only"), t.addClass(s.join(" "))
        }
    }), e.widget("ui.buttonset", {
        version: "1.10.2",
        options: {
            items: "button, input[type=button], input[type=submit], input[type=reset], input[type=checkbox], input[type=radio], a, :data(ui-button)"
        },
        _create: function () {
            this.element.addClass("ui-buttonset")
        },
        _init: function () {
            this.refresh()
        },
        _setOption: function (e, t) {
            e === "disabled" && this.buttons.button("option", e, t), this._super(e, t)
        },
        refresh: function () {
            var t = this.element.css("direction") === "rtl";
            this.buttons = this.element.find(this.options.items).filter(":ui-button").button("refresh").end().not(":ui-button").button().end().map(function () {
                return e(this).button("widget")[0]
            }).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass(t ? "ui-corner-right" : "ui-corner-left").end().filter(":last").addClass(t ? "ui-corner-left" : "ui-corner-right").end().end()
        },
        _destroy: function () {
            this.element.removeClass("ui-buttonset"), this.buttons.map(function () {
                return e(this).button("widget")[0]
            }).removeClass("ui-corner-left ui-corner-right").end().button("destroy")
        }
    })
}(jQuery),
function (e, t) {
    var n = {
        buttons: !0,
        height: !0,
        maxHeight: !0,
        maxWidth: !0,
        minHeight: !0,
        minWidth: !0,
        width: !0
    }, r = {
            maxHeight: !0,
            maxWidth: !0,
            minHeight: !0,
            minWidth: !0
        };
    e.widget("ui.dialog", {
        version: "1.10.2",
        options: {
            appendTo: "body",
            autoOpen: !0,
            buttons: [],
            closeOnEscape: !0,
            closeText: "close",
            dialogClass: "",
            draggable: !0,
            hide: null,
            height: "auto",
            maxHeight: null,
            maxWidth: null,
            minHeight: 150,
            minWidth: 150,
            modal: !1,
            position: {
                my: "center",
                at: "center",
                of: window,
                collision: "fit",
                using: function (t) {
                    var n = e(this).css(t).offset().top;
                    n < 0 && e(this).css("top", t.top - n)
                }
            },
            resizable: !0,
            show: null,
            title: null,
            width: 300,
            beforeClose: null,
            close: null,
            drag: null,
            dragStart: null,
            dragStop: null,
            focus: null,
            open: null,
            resize: null,
            resizeStart: null,
            resizeStop: null
        },
        _create: function () {
            this.originalCss = {
                display: this.element[0].style.display,
                width: this.element[0].style.width,
                minHeight: this.element[0].style.minHeight,
                maxHeight: this.element[0].style.maxHeight,
                height: this.element[0].style.height
            }, this.originalPosition = {
                parent: this.element.parent(),
                index: this.element.parent().children().index(this.element)
            }, this.originalTitle = this.element.attr("title"), this.options.title = this.options.title || this.originalTitle, this._createWrapper(), this.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(this.uiDialog), this._createTitlebar(), this._createButtonPane(), this.options.draggable && e.fn.draggable && this._makeDraggable(), this.options.resizable && e.fn.resizable && this._makeResizable(), this._isOpen = !1
        },
        _init: function () {
            this.options.autoOpen && this.open()
        },
        _appendTo: function () {
            var t = this.options.appendTo;
            return t && (t.jquery || t.nodeType) ? e(t) : this.document.find(t || "body").eq(0)
        },
        _destroy: function () {
            var e, t = this.originalPosition;
            this._destroyOverlay(), this.element.removeUniqueId().removeClass("ui-dialog-content ui-widget-content").css(this.originalCss).detach(), this.uiDialog.stop(!0, !0).remove(), this.originalTitle && this.element.attr("title", this.originalTitle), e = t.parent.children().eq(t.index), e.length && e[0] !== this.element[0] ? e.before(this.element) : t.parent.append(this.element)
        },
        widget: function () {
            return this.uiDialog
        },
        disable: e.noop,
        enable: e.noop,
        close: function (t) {
            var n = this;
            if (!this._isOpen || this._trigger("beforeClose", t) === !1) return;
            this._isOpen = !1, this._destroyOverlay(), this.opener.filter(":focusable").focus().length || e(this.document[0].activeElement).blur(), this._hide(this.uiDialog, this.options.hide, function () {
                n._trigger("close", t)
            })
        },
        isOpen: function () {
            return this._isOpen
        },
        moveToTop: function () {
            this._moveToTop()
        },
        _moveToTop: function (e, t) {
            var n = !! this.uiDialog.nextAll(":visible").insertBefore(this.uiDialog).length;
            return n && !t && this._trigger("focus", e), n
        },
        open: function () {
            var t = this;
            if (this._isOpen) {
                this._moveToTop() && this._focusTabbable();
                return
            }
            this._isOpen = !0, this.opener = e(this.document[0].activeElement), this._size(), this._position(), this._createOverlay(), this._moveToTop(null, !0), this._show(this.uiDialog, this.options.show, function () {
                t._focusTabbable(), t._trigger("focus")
            }), this._trigger("open")
        },
        _focusTabbable: function () {
            var e = this.element.find("[autofocus]");
            e.length || (e = this.element.find(":tabbable")), e.length || (e = this.uiDialogButtonPane.find(":tabbable")), e.length || (e = this.uiDialogTitlebarClose.filter(":tabbable")), e.length || (e = this.uiDialog), e.eq(0).focus()
        },
        _keepFocus: function (t) {
            function n() {
                var t = this.document[0].activeElement,
                    n = this.uiDialog[0] === t || e.contains(this.uiDialog[0], t);
                n || this._focusTabbable()
            }
            t.preventDefault(), n.call(this), this._delay(n)
        },
        _createWrapper: function () {
            this.uiDialog = e("<div>").addClass("ui-dialog ui-widget ui-widget-content ui-corner-all ui-front " + this.options.dialogClass).hide().attr({
                tabIndex: -1,
                role: "dialog"
            }).appendTo(this._appendTo()), this._on(this.uiDialog, {
                keydown: function (t) {
                    if (this.options.closeOnEscape && !t.isDefaultPrevented() && t.keyCode && t.keyCode === e.ui.keyCode.ESCAPE) {
                        t.preventDefault(), this.close(t);
                        return
                    }
                    if (t.keyCode !== e.ui.keyCode.TAB) return;
                    var n = this.uiDialog.find(":tabbable"),
                        r = n.filter(":first"),
                        i = n.filter(":last");
                    t.target !== i[0] && t.target !== this.uiDialog[0] || !! t.shiftKey ? (t.target === r[0] || t.target === this.uiDialog[0]) && t.shiftKey && (i.focus(1), t.preventDefault()) : (r.focus(1), t.preventDefault())
                },
                mousedown: function (e) {
                    this._moveToTop(e) && this._focusTabbable()
                }
            }), this.element.find("[aria-describedby]").length || this.uiDialog.attr({
                "aria-describedby": this.element.uniqueId().attr("id")
            })
        },
        _createTitlebar: function () {
            var t;
            this.uiDialogTitlebar = e("<div>").addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(this.uiDialog), this._on(this.uiDialogTitlebar, {
                mousedown: function (t) {
                    e(t.target).closest(".ui-dialog-titlebar-close") || this.uiDialog.focus()
                }
            }), this.uiDialogTitlebarClose = e("<button></button>").button({
                label: this.options.closeText,
                icons: {
                    primary: "ui-icon-closethick"
                },
                text: !1
            }).addClass("ui-dialog-titlebar-close").appendTo(this.uiDialogTitlebar), this._on(this.uiDialogTitlebarClose, {
                click: function (e) {
                    e.preventDefault(), this.close(e)
                }
            }), t = e("<span>").uniqueId().addClass("ui-dialog-title").prependTo(this.uiDialogTitlebar), this._title(t), this.uiDialog.attr({
                "aria-labelledby": t.attr("id")
            })
        },
        _title: function (e) {
            this.options.title || e.html("&#160;"), e.text(this.options.title)
        },
        _createButtonPane: function () {
            this.uiDialogButtonPane = e("<div>").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"), this.uiButtonSet = e("<div>").addClass("ui-dialog-buttonset").appendTo(this.uiDialogButtonPane), this._createButtons()
        },
        _createButtons: function () {
            var t = this,
                n = this.options.buttons;
            this.uiDialogButtonPane.remove(), this.uiButtonSet.empty();
            if (e.isEmptyObject(n) || e.isArray(n) && !n.length) {
                this.uiDialog.removeClass("ui-dialog-buttons");
                return
            }
            e.each(n, function (n, r) {
                var i, s;
                r = e.isFunction(r) ? {
                    click: r,
                    text: n
                } : r, r = e.extend({
                    type: "button"
                }, r), i = r.click, r.click = function () {
                    i.apply(t.element[0], arguments)
                }, s = {
                    icons: r.icons,
                    text: r.showText
                }, delete r.icons, delete r.showText, e("<button></button>", r).button(s).appendTo(t.uiButtonSet)
            }), this.uiDialog.addClass("ui-dialog-buttons"), this.uiDialogButtonPane.appendTo(this.uiDialog)
        },
        _makeDraggable: function () {
            function r(e) {
                return {
                    position: e.position,
                    offset: e.offset
                }
            }
            var t = this,
                n = this.options;
            this.uiDialog.draggable({
                cancel: ".ui-dialog-content, .ui-dialog-titlebar-close",
                handle: ".ui-dialog-titlebar",
                containment: "document",
                start: function (n, i) {
                    e(this).addClass("ui-dialog-dragging"), t._blockFrames(), t._trigger("dragStart", n, r(i))
                },
                drag: function (e, n) {
                    t._trigger("drag", e, r(n))
                },
                stop: function (i, s) {
                    n.position = [s.position.left - t.document.scrollLeft(), s.position.top - t.document.scrollTop()], e(this).removeClass("ui-dialog-dragging"), t._unblockFrames(), t._trigger("dragStop", i, r(s))
                }
            })
        },
        _makeResizable: function () {
            function o(e) {
                return {
                    originalPosition: e.originalPosition,
                    originalSize: e.originalSize,
                    position: e.position,
                    size: e.size
                }
            }
            var t = this,
                n = this.options,
                r = n.resizable,
                i = this.uiDialog.css("position"),
                s = typeof r == "string" ? r : "n,e,s,w,se,sw,ne,nw";
            this.uiDialog.resizable({
                cancel: ".ui-dialog-content",
                containment: "document",
                alsoResize: this.element,
                maxWidth: n.maxWidth,
                maxHeight: n.maxHeight,
                minWidth: n.minWidth,
                minHeight: this._minHeight(),
                handles: s,
                start: function (n, r) {
                    e(this).addClass("ui-dialog-resizing"), t._blockFrames(), t._trigger("resizeStart", n, o(r))
                },
                resize: function (e, n) {
                    t._trigger("resize", e, o(n))
                },
                stop: function (r, i) {
                    n.height = e(this).height(), n.width = e(this).width(), e(this).removeClass("ui-dialog-resizing"), t._unblockFrames(), t._trigger("resizeStop", r, o(i))
                }
            }).css("position", i)
        },
        _minHeight: function () {
            var e = this.options;
            return e.height === "auto" ? e.minHeight : Math.min(e.minHeight, e.height)
        },
        _position: function () {
            var e = this.uiDialog.is(":visible");
            e || this.uiDialog.show(), this.uiDialog.position(this.options.position), e || this.uiDialog.hide()
        },
        _setOptions: function (t) {
            var i = this,
                s = !1,
                o = {};
            e.each(t, function (e, t) {
                i._setOption(e, t), e in n && (s = !0), e in r && (o[e] = t)
            }), s && (this._size(), this._position()), this.uiDialog.is(":data(ui-resizable)") && this.uiDialog.resizable("option", o)
        },
        _setOption: function (e, t) {
            var n, r, i = this.uiDialog;
            e === "dialogClass" && i.removeClass(this.options.dialogClass).addClass(t);
            if (e === "disabled") return;
            this._super(e, t), e === "appendTo" && this.uiDialog.appendTo(this._appendTo()), e === "buttons" && this._createButtons(), e === "closeText" && this.uiDialogTitlebarClose.button({
                label: "" + t
            }), e === "draggable" && (n = i.is(":data(ui-draggable)"), n && !t && i.draggable("destroy"), !n && t && this._makeDraggable()), e === "position" && this._position(), e === "resizable" && (r = i.is(":data(ui-resizable)"), r && !t && i.resizable("destroy"), r && typeof t == "string" && i.resizable("option", "handles", t), !r && t !== !1 && this._makeResizable()), e === "title" && this._title(this.uiDialogTitlebar.find(".ui-dialog-title"))
        },
        _size: function () {
            var e, t, n, r = this.options;
            this.element.show().css({
                width: "auto",
                minHeight: 0,
                maxHeight: "none",
                height: 0
            }), r.minWidth > r.width && (r.width = r.minWidth), e = this.uiDialog.css({
                height: "auto",
                width: r.width
            }).outerHeight(), t = Math.max(0, r.minHeight - e), n = typeof r.maxHeight == "number" ? Math.max(0, r.maxHeight - e) : "none", r.height === "auto" ? this.element.css({
                minHeight: t,
                maxHeight: n,
                height: "auto"
            }) : this.element.height(Math.max(0, r.height - e)), this.uiDialog.is(":data(ui-resizable)") && this.uiDialog.resizable("option", "minHeight", this._minHeight())
        },
        _blockFrames: function () {
            this.iframeBlocks = this.document.find("iframe").map(function () {
                var t = e(this);
                return e("<div>").css({
                    position: "absolute",
                    width: t.outerWidth(),
                    height: t.outerHeight()
                }).appendTo(t.parent()).offset(t.offset())[0]
            })
        },
        _unblockFrames: function () {
            this.iframeBlocks && (this.iframeBlocks.remove(), delete this.iframeBlocks)
        },
        _allowInteraction: function (t) {
            return e(t.target).closest(".ui-dialog").length ? !0 : !! e(t.target).closest(".ui-datepicker").length
        },
        _createOverlay: function () {
            if (!this.options.modal) return;
            var t = this,
                n = this.widgetFullName;
            e.ui.dialog.overlayInstances || this._delay(function () {
                e.ui.dialog.overlayInstances && this.document.bind("focusin.dialog", function (r) {
                    t._allowInteraction(r) || (r.preventDefault(), e(".ui-dialog:visible:last .ui-dialog-content").data(n)._focusTabbable())
                })
            }), this.overlay = e("<div>").addClass("ui-widget-overlay ui-front").appendTo(this._appendTo()), this._on(this.overlay, {
                mousedown: "_keepFocus"
            }), e.ui.dialog.overlayInstances++
        },
        _destroyOverlay: function () {
            if (!this.options.modal) return;
            this.overlay && (e.ui.dialog.overlayInstances--, e.ui.dialog.overlayInstances || this.document.unbind("focusin.dialog"), this.overlay.remove(), this.overlay = null)
        }
    }), e.ui.dialog.overlayInstances = 0, e.uiBackCompat !== !1 && e.widget("ui.dialog", e.ui.dialog, {
        _position: function () {
            var t = this.options.position,
                n = [],
                r = [0, 0],
                i;
            if (t) {
                if (typeof t == "string" || typeof t == "object" && "0" in t) n = t.split ? t.split(" ") : [t[0], t[1]], n.length === 1 && (n[1] = n[0]), e.each(["left", "top"], function (e, t) {
                    +n[e] === n[e] && (r[e] = n[e], n[e] = t)
                }), t = {
                    my: n[0] + (r[0] < 0 ? r[0] : "+" + r[0]) + " " + n[1] + (r[1] < 0 ? r[1] : "+" + r[1]),
                    at: n.join(" ")
                };
                t = e.extend({}, e.ui.dialog.prototype.options.position, t)
            } else t = e.ui.dialog.prototype.options.position;
            i = this.uiDialog.is(":visible"), i || this.uiDialog.show(), this.uiDialog.position(t), i || this.uiDialog.hide()
        }
    })
}(jQuery),
function (e, t) {
    e.widget("ui.menu", {
        version: "1.10.2",
        defaultElement: "<ul>",
        delay: 300,
        options: {
            icons: {
                submenu: "ui-icon-carat-1-e"
            },
            menus: "ul",
            position: {
                my: "left top",
                at: "right top"
            },
            role: "menu",
            blur: null,
            focus: null,
            select: null
        },
        _create: function () {
            this.activeMenu = this.element, this.mouseHandled = !1, this.element.uniqueId().addClass("ui-menu ui-widget ui-widget-content ui-corner-all").toggleClass("ui-menu-icons", !! this.element.find(".ui-icon").length).attr({
                role: this.options.role,
                tabIndex: 0
            }).bind("click" + this.eventNamespace, e.proxy(function (e) {
                this.options.disabled && e.preventDefault()
            }, this)), this.options.disabled && this.element.addClass("ui-state-disabled").attr("aria-disabled", "true"), this._on({
                "mousedown .ui-menu-item > a": function (e) {
                    e.preventDefault()
                },
                "click .ui-state-disabled > a": function (e) {
                    e.preventDefault()
                },
                "click .ui-menu-item:has(a)": function (t) {
                    var n = e(t.target).closest(".ui-menu-item");
                    !this.mouseHandled && n.not(".ui-state-disabled").length && (this.mouseHandled = !0, this.select(t), n.has(".ui-menu").length ? this.expand(t) : this.element.is(":focus") || (this.element.trigger("focus", [!0]), this.active && this.active.parents(".ui-menu").length === 1 && clearTimeout(this.timer)))
                },
                "mouseenter .ui-menu-item": function (t) {
                    var n = e(t.currentTarget);
                    n.siblings().children(".ui-state-active").removeClass("ui-state-active"), this.focus(t, n)
                },
                mouseleave: "collapseAll",
                "mouseleave .ui-menu": "collapseAll",
                focus: function (e, t) {
                    var n = this.active || this.element.children(".ui-menu-item").eq(0);
                    t || this.focus(e, n)
                },
                blur: function (t) {
                    this._delay(function () {
                        e.contains(this.element[0], this.document[0].activeElement) || this.collapseAll(t)
                    })
                },
                keydown: "_keydown"
            }), this.refresh(), this._on(this.document, {
                click: function (t) {
                    e(t.target).closest(".ui-menu").length || this.collapseAll(t), this.mouseHandled = !1
                }
            })
        },
        _destroy: function () {
            this.element.removeAttr("aria-activedescendant").find(".ui-menu").addBack().removeClass("ui-menu ui-widget ui-widget-content ui-corner-all ui-menu-icons").removeAttr("role").removeAttr("tabIndex").removeAttr("aria-labelledby").removeAttr("aria-expanded").removeAttr("aria-hidden").removeAttr("aria-disabled").removeUniqueId().show(), this.element.find(".ui-menu-item").removeClass("ui-menu-item").removeAttr("role").removeAttr("aria-disabled").children("a").removeUniqueId().removeClass("ui-corner-all ui-state-hover").removeAttr("tabIndex").removeAttr("role").removeAttr("aria-haspopup").children().each(function () {
                var t = e(this);
                t.data("ui-menu-submenu-carat") && t.remove()
            }), this.element.find(".ui-menu-divider").removeClass("ui-menu-divider ui-widget-content")
        },
        _keydown: function (t) {
            function a(e) {
                return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&")
            }
            var n, r, i, s, o, u = !0;
            switch (t.keyCode) {
            case e.ui.keyCode.PAGE_UP:
                this.previousPage(t);
                break;
            case e.ui.keyCode.PAGE_DOWN:
                this.nextPage(t);
                break;
            case e.ui.keyCode.HOME:
                this._move("first", "first", t);
                break;
            case e.ui.keyCode.END:
                this._move("last", "last", t);
                break;
            case e.ui.keyCode.UP:
                this.previous(t);
                break;
            case e.ui.keyCode.DOWN:
                this.next(t);
                break;
            case e.ui.keyCode.LEFT:
                this.collapse(t);
                break;
            case e.ui.keyCode.RIGHT:
                this.active && !this.active.is(".ui-state-disabled") && this.expand(t);
                break;
            case e.ui.keyCode.ENTER:
            case e.ui.keyCode.SPACE:
                this._activate(t);
                break;
            case e.ui.keyCode.ESCAPE:
                this.collapse(t);
                break;
            default:
                u = !1, r = this.previousFilter || "", i = String.fromCharCode(t.keyCode), s = !1, clearTimeout(this.filterTimer), i === r ? s = !0 : i = r + i, o = new RegExp("^" + a(i), "i"), n = this.activeMenu.children(".ui-menu-item").filter(function () {
                    return o.test(e(this).children("a").text())
                }), n = s && n.index(this.active.next()) !== -1 ? this.active.nextAll(".ui-menu-item") : n, n.length || (i = String.fromCharCode(t.keyCode), o = new RegExp("^" + a(i), "i"), n = this.activeMenu.children(".ui-menu-item").filter(function () {
                    return o.test(e(this).children("a").text())
                })), n.length ? (this.focus(t, n), n.length > 1 ? (this.previousFilter = i, this.filterTimer = this._delay(function () {
                    delete this.previousFilter
                }, 1e3)) : delete this.previousFilter) : delete this.previousFilter
            }
            u && t.preventDefault()
        },
        _activate: function (e) {
            this.active.is(".ui-state-disabled") || (this.active.children("a[aria-haspopup='true']").length ? this.expand(e) : this.select(e))
        },
        refresh: function () {
            var t, n = this.options.icons.submenu,
                r = this.element.find(this.options.menus);
            r.filter(":not(.ui-menu)").addClass("ui-menu ui-widget ui-widget-content ui-corner-all").hide().attr({
                role: this.options.role,
                "aria-hidden": "true",
                "aria-expanded": "false"
            }).each(function () {
                var t = e(this),
                    r = t.prev("a"),
                    i = e("<span>").addClass("ui-menu-icon ui-icon " + n).data("ui-menu-submenu-carat", !0);
                r.attr("aria-haspopup", "true").prepend(i), t.attr("aria-labelledby", r.attr("id"))
            }), t = r.add(this.element), t.children(":not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role", "presentation").children("a").uniqueId().addClass("ui-corner-all").attr({
                tabIndex: -1,
                role: this._itemRole()
            }), t.children(":not(.ui-menu-item)").each(function () {
                var t = e(this);
                /[^\-\u2014\u2013\s]/.test(t.text()) || t.addClass("ui-widget-content ui-menu-divider")
            }), t.children(".ui-state-disabled").attr("aria-disabled", "true"), this.active && !e.contains(this.element[0], this.active[0]) && this.blur()
        },
        _itemRole: function () {
            return {
                menu: "menuitem",
                listbox: "option"
            }[this.options.role]
        },
        _setOption: function (e, t) {
            e === "icons" && this.element.find(".ui-menu-icon").removeClass(this.options.icons.submenu).addClass(t.submenu), this._super(e, t)
        },
        focus: function (e, t) {
            var n, r;
            this.blur(e, e && e.type === "focus"), this._scrollIntoView(t), this.active = t.first(), r = this.active.children("a").addClass("ui-state-focus"), this.options.role && this.element.attr("aria-activedescendant", r.attr("id")), this.active.parent().closest(".ui-menu-item").children("a:first").addClass("ui-state-active"), e && e.type === "keydown" ? this._close() : this.timer = this._delay(function () {
                this._close()
            }, this.delay), n = t.children(".ui-menu"), n.length && /^mouse/.test(e.type) && this._startOpening(n), this.activeMenu = t.parent(), this._trigger("focus", e, {
                item: t
            })
        },
        _scrollIntoView: function (t) {
            var n, r, i, s, o, u;
            this._hasScroll() && (n = parseFloat(e.css(this.activeMenu[0], "borderTopWidth")) || 0, r = parseFloat(e.css(this.activeMenu[0], "paddingTop")) || 0, i = t.offset().top - this.activeMenu.offset().top - n - r, s = this.activeMenu.scrollTop(), o = this.activeMenu.height(), u = t.height(), i < 0 ? this.activeMenu.scrollTop(s + i) : i + u > o && this.activeMenu.scrollTop(s + i - o + u))
        },
        blur: function (e, t) {
            t || clearTimeout(this.timer);
            if (!this.active) return;
            this.active.children("a").removeClass("ui-state-focus"), this.active = null, this._trigger("blur", e, {
                item: this.active
            })
        },
        _startOpening: function (e) {
            clearTimeout(this.timer);
            if (e.attr("aria-hidden") !== "true") return;
            this.timer = this._delay(function () {
                this._close(), this._open(e)
            }, this.delay)
        },
        _open: function (t) {
            var n = e.extend({
                of: this.active
            }, this.options.position);
            clearTimeout(this.timer), this.element.find(".ui-menu").not(t.parents(".ui-menu")).hide().attr("aria-hidden", "true"), t.show().removeAttr("aria-hidden").attr("aria-expanded", "true").position(n)
        },
        collapseAll: function (t, n) {
            clearTimeout(this.timer), this.timer = this._delay(function () {
                var r = n ? this.element : e(t && t.target).closest(this.element.find(".ui-menu"));
                r.length || (r = this.element), this._close(r), this.blur(t), this.activeMenu = r
            }, this.delay)
        },
        _close: function (e) {
            e || (e = this.active ? this.active.parent() : this.element), e.find(".ui-menu").hide().attr("aria-hidden", "true").attr("aria-expanded", "false").end().find("a.ui-state-active").removeClass("ui-state-active")
        },
        collapse: function (e) {
            var t = this.active && this.active.parent().closest(".ui-menu-item", this.element);
            t && t.length && (this._close(), this.focus(e, t))
        },
        expand: function (e) {
            var t = this.active && this.active.children(".ui-menu ").children(".ui-menu-item").first();
            t && t.length && (this._open(t.parent()), this._delay(function () {
                this.focus(e, t)
            }))
        },
        next: function (e) {
            this._move("next", "first", e)
        },
        previous: function (e) {
            this._move("prev", "last", e)
        },
        isFirstItem: function () {
            return this.active && !this.active.prevAll(".ui-menu-item").length
        },
        isLastItem: function () {
            return this.active && !this.active.nextAll(".ui-menu-item").length
        },
        _move: function (e, t, n) {
            var r;
            this.active && (e === "first" || e === "last" ? r = this.active[e === "first" ? "prevAll" : "nextAll"](".ui-menu-item").eq(-1) : r = this.active[e + "All"](".ui-menu-item").eq(0));
            if (!r || !r.length || !this.active) r = this.activeMenu.children(".ui-menu-item")[t]();
            this.focus(n, r)
        },
        nextPage: function (t) {
            var n, r, i;
            if (!this.active) {
                this.next(t);
                return
            }
            if (this.isLastItem()) return;
            this._hasScroll() ? (r = this.active.offset().top, i = this.element.height(), this.active.nextAll(".ui-menu-item").each(function () {
                return n = e(this), n.offset().top - r - i < 0
            }), this.focus(t, n)) : this.focus(t, this.activeMenu.children(".ui-menu-item")[this.active ? "last" : "first"]())
        },
        previousPage: function (t) {
            var n, r, i;
            if (!this.active) {
                this.next(t);
                return
            }
            if (this.isFirstItem()) return;
            this._hasScroll() ? (r = this.active.offset().top, i = this.element.height(), this.active.prevAll(".ui-menu-item").each(function () {
                return n = e(this), n.offset().top - r + i > 0
            }), this.focus(t, n)) : this.focus(t, this.activeMenu.children(".ui-menu-item").first())
        },
        _hasScroll: function () {
            return this.element.outerHeight() < this.element.prop("scrollHeight")
        },
        select: function (t) {
            this.active = this.active || e(t.target).closest(".ui-menu-item");
            var n = {
                item: this.active
            };
            this.active.has(".ui-menu").length || this.collapseAll(t, !0), this._trigger("select", t, n)
        }
    })
}(jQuery),
function (e, t) {
    e.widget("ui.progressbar", {
        version: "1.10.2",
        options: {
            max: 100,
            value: 0,
            change: null,
            complete: null
        },
        min: 0,
        _create: function () {
            this.oldValue = this.options.value = this._constrainedValue(), this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({
                role: "progressbar",
                "aria-valuemin": this.min
            }), this.valueDiv = e("<div class='ui-progressbar-value ui-widget-header ui-corner-left'></div>").appendTo(this.element), this._refreshValue()
        },
        _destroy: function () {
            this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"), this.valueDiv.remove()
        },
        value: function (e) {
            if (e === t) return this.options.value;
            this.options.value = this._constrainedValue(e), this._refreshValue()
        },
        _constrainedValue: function (e) {
            return e === t && (e = this.options.value), this.indeterminate = e === !1, typeof e != "number" && (e = 0), this.indeterminate ? !1 : Math.min(this.options.max, Math.max(this.min, e))
        },
        _setOptions: function (e) {
            var t = e.value;
            delete e.value, this._super(e), this.options.value = this._constrainedValue(t), this._refreshValue()
        },
        _setOption: function (e, t) {
            e === "max" && (t = Math.max(this.min, t)), this._super(e, t)
        },
        _percentage: function () {
            return this.indeterminate ? 100 : 100 * (this.options.value - this.min) / (this.options.max - this.min)
        },
        _refreshValue: function () {
            var t = this.options.value,
                n = this._percentage();
            this.valueDiv.toggle(this.indeterminate || t > this.min).toggleClass("ui-corner-right", t === this.options.max).width(n.toFixed(0) + "%"), this.element.toggleClass("ui-progressbar-indeterminate", this.indeterminate), this.indeterminate ? (this.element.removeAttr("aria-valuenow"), this.overlayDiv || (this.overlayDiv = e("<div class='ui-progressbar-overlay'></div>").appendTo(this.valueDiv))) : (this.element.attr({
                "aria-valuemax": this.options.max,
                "aria-valuenow": t
            }), this.overlayDiv && (this.overlayDiv.remove(), this.overlayDiv = null)), this.oldValue !== t && (this.oldValue = t, this._trigger("change")), t === this.options.max && this._trigger("complete")
        }
    })
}(jQuery),
function (e, t) {
    var n = 5;
    e.widget("ui.slider", e.ui.mouse, {
        version: "1.10.2",
        widgetEventPrefix: "slide",
        options: {
            animate: !1,
            distance: 0,
            max: 100,
            min: 0,
            orientation: "horizontal",
            range: !1,
            step: 1,
            value: 0,
            values: null,
            change: null,
            slide: null,
            start: null,
            stop: null
        },
        _create: function () {
            this._keySliding = !1, this._mouseSliding = !1, this._animateOff = !0, this._handleIndex = null, this._detectOrientation(), this._mouseInit(), this.element.addClass("ui-slider ui-slider-" + this.orientation + " ui-widget" + " ui-widget-content" + " ui-corner-all"), this._refresh(), this._setOption("disabled", this.options.disabled), this._animateOff = !1
        },
        _refresh: function () {
            this._createRange(), this._createHandles(), this._setupEvents(), this._refreshValue()
        },
        _createHandles: function () {
            var t, n, r = this.options,
                i = this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),
                s = "<a class='ui-slider-handle ui-state-default ui-corner-all' href='#'></a>",
                o = [];
            n = r.values && r.values.length || 1, i.length > n && (i.slice(n).remove(), i = i.slice(0, n));
            for (t = i.length; t < n; t++) o.push(s);
            this.handles = i.add(e(o.join("")).appendTo(this.element)), this.handle = this.handles.eq(0), this.handles.each(function (t) {
                e(this).data("ui-slider-handle-index", t)
            })
        },
        _createRange: function () {
            var t = this.options,
                n = "";
            t.range ? (t.range === !0 && (t.values ? t.values.length && t.values.length !== 2 ? t.values = [t.values[0], t.values[0]] : e.isArray(t.values) && (t.values = t.values.slice(0)) : t.values = [this._valueMin(), this._valueMin()]), !this.range || !this.range.length ? (this.range = e("<div></div>").appendTo(this.element), n = "ui-slider-range ui-widget-header ui-corner-all") : this.range.removeClass("ui-slider-range-min ui-slider-range-max").css({
                left: "",
                bottom: ""
            }), this.range.addClass(n + (t.range === "min" || t.range === "max" ? " ui-slider-range-" + t.range : ""))) : this.range = e([])
        },
        _setupEvents: function () {
            var e = this.handles.add(this.range).filter("a");
            this._off(e), this._on(e, this._handleEvents), this._hoverable(e), this._focusable(e)
        },
        _destroy: function () {
            this.handles.remove(), this.range.remove(), this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-widget ui-widget-content ui-corner-all"), this._mouseDestroy()
        },
        _mouseCapture: function (t) {
            var n, r, i, s, o, u, a, f, l = this,
                c = this.options;
            return c.disabled ? !1 : (this.elementSize = {
                width: this.element.outerWidth(),
                height: this.element.outerHeight()
            }, this.elementOffset = this.element.offset(), n = {
                x: t.pageX,
                y: t.pageY
            }, r = this._normValueFromMouse(n), i = this._valueMax() - this._valueMin() + 1, this.handles.each(function (t) {
                var n = Math.abs(r - l.values(t));
                if (i > n || i === n && (t === l._lastChangedValue || l.values(t) === c.min)) i = n, s = e(this), o = t
            }), u = this._start(t, o), u === !1 ? !1 : (this._mouseSliding = !0, this._handleIndex = o, s.addClass("ui-state-active").focus(), a = s.offset(), f = !e(t.target).parents().addBack().is(".ui-slider-handle"), this._clickOffset = f ? {
                left: 0,
                top: 0
            } : {
                left: t.pageX - a.left - s.width() / 2,
                top: t.pageY - a.top - s.height() / 2 - (parseInt(s.css("borderTopWidth"), 10) || 0) - (parseInt(s.css("borderBottomWidth"), 10) || 0) + (parseInt(s.css("marginTop"), 10) || 0)
            }, this.handles.hasClass("ui-state-hover") || this._slide(t, o, r), this._animateOff = !0, !0))
        },
        _mouseStart: function () {
            return !0
        },
        _mouseDrag: function (e) {
            var t = {
                x: e.pageX,
                y: e.pageY
            }, n = this._normValueFromMouse(t);
            return this._slide(e, this._handleIndex, n), !1
        },
        _mouseStop: function (e) {
            return this.handles.removeClass("ui-state-active"), this._mouseSliding = !1, this._stop(e, this._handleIndex), this._change(e, this._handleIndex), this._handleIndex = null, this._clickOffset = null, this._animateOff = !1, !1
        },
        _detectOrientation: function () {
            this.orientation = this.options.orientation === "vertical" ? "vertical" : "horizontal"
        },
        _normValueFromMouse: function (e) {
            var t, n, r, i, s;
            return this.orientation === "horizontal" ? (t = this.elementSize.width, n = e.x - this.elementOffset.left - (this._clickOffset ? this._clickOffset.left : 0)) : (t = this.elementSize.height, n = e.y - this.elementOffset.top - (this._clickOffset ? this._clickOffset.top : 0)), r = n / t, r > 1 && (r = 1), r < 0 && (r = 0), this.orientation === "vertical" && (r = 1 - r), i = this._valueMax() - this._valueMin(), s = this._valueMin() + r * i, this._trimAlignValue(s)
        },
        _start: function (e, t) {
            var n = {
                handle: this.handles[t],
                value: this.value()
            };
            return this.options.values && this.options.values.length && (n.value = this.values(t), n.values = this.values()), this._trigger("start", e, n)
        },
        _slide: function (e, t, n) {
            var r, i, s;
            this.options.values && this.options.values.length ? (r = this.values(t ? 0 : 1), this.options.values.length === 2 && this.options.range === !0 && (t === 0 && n > r || t === 1 && n < r) && (n = r), n !== this.values(t) && (i = this.values(), i[t] = n, s = this._trigger("slide", e, {
                handle: this.handles[t],
                value: n,
                values: i
            }), r = this.values(t ? 0 : 1), s !== !1 && this.values(t, n, !0))) : n !== this.value() && (s = this._trigger("slide", e, {
                handle: this.handles[t],
                value: n
            }), s !== !1 && this.value(n))
        },
        _stop: function (e, t) {
            var n = {
                handle: this.handles[t],
                value: this.value()
            };
            this.options.values && this.options.values.length && (n.value = this.values(t), n.values = this.values()), this._trigger("stop", e, n)
        },
        _change: function (e, t) {
            if (!this._keySliding && !this._mouseSliding) {
                var n = {
                    handle: this.handles[t],
                    value: this.value()
                };
                this.options.values && this.options.values.length && (n.value = this.values(t), n.values = this.values()), this._lastChangedValue = t, this._trigger("change", e, n)
            }
        },
        value: function (e) {
            if (arguments.length) {
                this.options.value = this._trimAlignValue(e), this._refreshValue(), this._change(null, 0);
                return
            }
            return this._value()
        },
        values: function (t, n) {
            var r, i, s;
            if (arguments.length > 1) {
                this.options.values[t] = this._trimAlignValue(n), this._refreshValue(), this._change(null, t);
                return
            }
            if (!arguments.length) return this._values();
            if (!e.isArray(arguments[0])) return this.options.values && this.options.values.length ? this._values(t) : this.value();
            r = this.options.values, i = arguments[0];
            for (s = 0; s < r.length; s += 1) r[s] = this._trimAlignValue(i[s]), this._change(null, s);
            this._refreshValue()
        },
        _setOption: function (t, n) {
            var r, i = 0;
            t === "range" && this.options.range === !0 && (n === "min" ? (this.options.value = this._values(0), this.options.values = null) : n === "max" && (this.options.value = this._values(this.options.values.length - 1), this.options.values = null)), e.isArray(this.options.values) && (i = this.options.values.length), e.Widget.prototype._setOption.apply(this, arguments);
            switch (t) {
            case "orientation":
                this._detectOrientation(), this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-" + this.orientation), this._refreshValue();
                break;
            case "value":
                this._animateOff = !0, this._refreshValue(), this._change(null, 0), this._animateOff = !1;
                break;
            case "values":
                this._animateOff = !0, this._refreshValue();
                for (r = 0; r < i; r += 1) this._change(null, r);
                this._animateOff = !1;
                break;
            case "min":
            case "max":
                this._animateOff = !0, this._refreshValue(), this._animateOff = !1;
                break;
            case "range":
                this._animateOff = !0, this._refresh(), this._animateOff = !1
            }
        },
        _value: function () {
            var e = this.options.value;
            return e = this._trimAlignValue(e), e
        },
        _values: function (e) {
            var t, n, r;
            if (arguments.length) return t = this.options.values[e], t = this._trimAlignValue(t), t;
            if (this.options.values && this.options.values.length) {
                n = this.options.values.slice();
                for (r = 0; r < n.length; r += 1) n[r] = this._trimAlignValue(n[r]);
                return n
            }
            return []
        },
        _trimAlignValue: function (e) {
            if (e <= this._valueMin()) return this._valueMin();
            if (e >= this._valueMax()) return this._valueMax();
            var t = this.options.step > 0 ? this.options.step : 1,
                n = (e - this._valueMin()) % t,
                r = e - n;
            return Math.abs(n) * 2 >= t && (r += n > 0 ? t : -t), parseFloat(r.toFixed(5))
        },
        _valueMin: function () {
            return this.options.min
        },
        _valueMax: function () {
            return this.options.max
        },
        _refreshValue: function () {
            var t, n, r, i, s, o = this.options.range,
                u = this.options,
                a = this,
                f = this._animateOff ? !1 : u.animate,
                l = {};
            this.options.values && this.options.values.length ? this.handles.each(function (r) {
                n = (a.values(r) - a._valueMin()) / (a._valueMax() - a._valueMin()) * 100, l[a.orientation === "horizontal" ? "left" : "bottom"] = n + "%", e(this).stop(1, 1)[f ? "animate" : "css"](l, u.animate), a.options.range === !0 && (a.orientation === "horizontal" ? (r === 0 && a.range.stop(1, 1)[f ? "animate" : "css"]({
                    left: n + "%"
                }, u.animate), r === 1 && a.range[f ? "animate" : "css"]({
                    width: n - t + "%"
                }, {
                    queue: !1,
                    duration: u.animate
                })) : (r === 0 && a.range.stop(1, 1)[f ? "animate" : "css"]({
                    bottom: n + "%"
                }, u.animate), r === 1 && a.range[f ? "animate" : "css"]({
                    height: n - t + "%"
                }, {
                    queue: !1,
                    duration: u.animate
                }))), t = n
            }) : (r = this.value(), i = this._valueMin(), s = this._valueMax(), n = s !== i ? (r - i) / (s - i) * 100 : 0, l[this.orientation === "horizontal" ? "left" : "bottom"] = n + "%", this.handle.stop(1, 1)[f ? "animate" : "css"](l, u.animate), o === "min" && this.orientation === "horizontal" && this.range.stop(1, 1)[f ? "animate" : "css"]({
                width: n + "%"
            }, u.animate), o === "max" && this.orientation === "horizontal" && this.range[f ? "animate" : "css"]({
                width: 100 - n + "%"
            }, {
                queue: !1,
                duration: u.animate
            }), o === "min" && this.orientation === "vertical" && this.range.stop(1, 1)[f ? "animate" : "css"]({
                height: n + "%"
            }, u.animate), o === "max" && this.orientation === "vertical" && this.range[f ? "animate" : "css"]({
                height: 100 - n + "%"
            }, {
                queue: !1,
                duration: u.animate
            }))
        },
        _handleEvents: {
            keydown: function (t) {
                var r, i, s, o, u = e(t.target).data("ui-slider-handle-index");
                switch (t.keyCode) {
                case e.ui.keyCode.HOME:
                case e.ui.keyCode.END:
                case e.ui.keyCode.PAGE_UP:
                case e.ui.keyCode.PAGE_DOWN:
                case e.ui.keyCode.UP:
                case e.ui.keyCode.RIGHT:
                case e.ui.keyCode.DOWN:
                case e.ui.keyCode.LEFT:
                    t.preventDefault();
                    if (!this._keySliding) {
                        this._keySliding = !0, e(t.target).addClass("ui-state-active"), r = this._start(t, u);
                        if (r === !1) return
                    }
                }
                o = this.options.step, this.options.values && this.options.values.length ? i = s = this.values(u) : i = s = this.value();
                switch (t.keyCode) {
                case e.ui.keyCode.HOME:
                    s = this._valueMin();
                    break;
                case e.ui.keyCode.END:
                    s = this._valueMax();
                    break;
                case e.ui.keyCode.PAGE_UP:
                    s = this._trimAlignValue(i + (this._valueMax() - this._valueMin()) / n);
                    break;
                case e.ui.keyCode.PAGE_DOWN:
                    s = this._trimAlignValue(i - (this._valueMax() - this._valueMin()) / n);
                    break;
                case e.ui.keyCode.UP:
                case e.ui.keyCode.RIGHT:
                    if (i === this._valueMax()) return;
                    s = this._trimAlignValue(i + o);
                    break;
                case e.ui.keyCode.DOWN:
                case e.ui.keyCode.LEFT:
                    if (i === this._valueMin()) return;
                    s = this._trimAlignValue(i - o)
                }
                this._slide(t, u, s)
            },
            click: function (e) {
                e.preventDefault()
            },
            keyup: function (t) {
                var n = e(t.target).data("ui-slider-handle-index");
                this._keySliding && (this._keySliding = !1, this._stop(t, n), this._change(t, n), e(t.target).removeClass("ui-state-active"))
            }
        }
    })
}(jQuery),
function (e) {
    function t(e) {
        return function () {
            var t = this.element.val();
            e.apply(this, arguments), this._refresh(), t !== this.element.val() && this._trigger("change")
        }
    }
    e.widget("ui.spinner", {
        version: "1.10.2",
        defaultElement: "<input>",
        widgetEventPrefix: "spin",
        options: {
            culture: null,
            icons: {
                down: "ui-icon-triangle-1-s",
                up: "ui-icon-triangle-1-n"
            },
            incremental: !0,
            max: null,
            min: null,
            numberFormat: null,
            page: 10,
            step: 1,
            change: null,
            spin: null,
            start: null,
            stop: null
        },
        _create: function () {
            this._setOption("max", this.options.max), this._setOption("min", this.options.min), this._setOption("step", this.options.step), this._value(this.element.val(), !0), this._draw(), this._on(this._events), this._refresh(), this._on(this.window, {
                beforeunload: function () {
                    this.element.removeAttr("autocomplete")
                }
            })
        },
        _getCreateOptions: function () {
            var t = {}, n = this.element;
            return e.each(["min", "max", "step"], function (e, r) {
                var i = n.attr(r);
                i !== undefined && i.length && (t[r] = i)
            }), t
        },
        _events: {
            keydown: function (e) {
                this._start(e) && this._keydown(e) && e.preventDefault()
            },
            keyup: "_stop",
            focus: function () {
                this.previous = this.element.val()
            },
            blur: function (e) {
                if (this.cancelBlur) {
                    delete this.cancelBlur;
                    return
                }
                this._stop(), this._refresh(), this.previous !== this.element.val() && this._trigger("change", e)
            },
            mousewheel: function (e, t) {
                if (!t) return;
                if (!this.spinning && !this._start(e)) return !1;
                this._spin((t > 0 ? 1 : -1) * this.options.step, e), clearTimeout(this.mousewheelTimer), this.mousewheelTimer = this._delay(function () {
                    this.spinning && this._stop(e)
                }, 100), e.preventDefault()
            },
            "mousedown .ui-spinner-button": function (t) {
                function r() {
                    var e = this.element[0] === this.document[0].activeElement;
                    e || (this.element.focus(), this.previous = n, this._delay(function () {
                        this.previous = n
                    }))
                }
                var n;
                n = this.element[0] === this.document[0].activeElement ? this.previous : this.element.val(), t.preventDefault(), r.call(this), this.cancelBlur = !0, this._delay(function () {
                    delete this.cancelBlur, r.call(this)
                });
                if (this._start(t) === !1) return;
                this._repeat(null, e(t.currentTarget).hasClass("ui-spinner-up") ? 1 : -1, t)
            },
            "mouseup .ui-spinner-button": "_stop",
            "mouseenter .ui-spinner-button": function (t) {
                if (!e(t.currentTarget).hasClass("ui-state-active")) return;
                if (this._start(t) === !1) return !1;
                this._repeat(null, e(t.currentTarget).hasClass("ui-spinner-up") ? 1 : -1, t)
            },
            "mouseleave .ui-spinner-button": "_stop"
        },
        _draw: function () {
            var e = this.uiSpinner = this.element.addClass("ui-spinner-input").attr("autocomplete", "off").wrap(this._uiSpinnerHtml()).parent().append(this._buttonHtml());
            this.element.attr("role", "spinbutton"), this.buttons = e.find(".ui-spinner-button").attr("tabIndex", -1).button().removeClass("ui-corner-all"), this.buttons.height() > Math.ceil(e.height() * .5) && e.height() > 0 && e.height(e.height()), this.options.disabled && this.disable()
        },
        _keydown: function (t) {
            var n = this.options,
                r = e.ui.keyCode;
            switch (t.keyCode) {
            case r.UP:
                return this._repeat(null, 1, t), !0;
            case r.DOWN:
                return this._repeat(null, -1, t), !0;
            case r.PAGE_UP:
                return this._repeat(null, n.page, t), !0;
            case r.PAGE_DOWN:
                return this._repeat(null, -n.page, t), !0
            }
            return !1
        },
        _uiSpinnerHtml: function () {
            return "<span class='ui-spinner ui-widget ui-widget-content ui-corner-all'></span>"
        },
        _buttonHtml: function () {
            return "<a class='ui-spinner-button ui-spinner-up ui-corner-tr'><span class='ui-icon " + this.options.icons.up + "'>&#9650;</span>" + "</a>" + "<a class='ui-spinner-button ui-spinner-down ui-corner-br'>" + "<span class='ui-icon " + this.options.icons.down + "'>&#9660;</span>" + "</a>"
        },
        _start: function (e) {
            return !this.spinning && this._trigger("start", e) === !1 ? !1 : (this.counter || (this.counter = 1), this.spinning = !0, !0)
        },
        _repeat: function (e, t, n) {
            e = e || 500, clearTimeout(this.timer), this.timer = this._delay(function () {
                this._repeat(40, t, n)
            }, e), this._spin(t * this.options.step, n)
        },
        _spin: function (e, t) {
            var n = this.value() || 0;
            this.counter || (this.counter = 1), n = this._adjustValue(n + e * this._increment(this.counter));
            if (!this.spinning || this._trigger("spin", t, {
                value: n
            }) !== !1) this._value(n), this.counter++
        },
        _increment: function (t) {
            var n = this.options.incremental;
            return n ? e.isFunction(n) ? n(t) : Math.floor(t * t * t / 5e4 - t * t / 500 + 17 * t / 200 + 1) : 1
        },
        _precision: function () {
            var e = this._precisionOf(this.options.step);
            return this.options.min !== null && (e = Math.max(e, this._precisionOf(this.options.min))), e
        },
        _precisionOf: function (e) {
            var t = e.toString(),
                n = t.indexOf(".");
            return n === -1 ? 0 : t.length - n - 1
        },
        _adjustValue: function (e) {
            var t, n, r = this.options;
            return t = r.min !== null ? r.min : 0, n = e - t, n = Math.round(n / r.step) * r.step, e = t + n, e = parseFloat(e.toFixed(this._precision())), r.max !== null && e > r.max ? r.max : r.min !== null && e < r.min ? r.min : e
        },
        _stop: function (e) {
            if (!this.spinning) return;
            clearTimeout(this.timer), clearTimeout(this.mousewheelTimer), this.counter = 0, this.spinning = !1, this._trigger("stop", e)
        },
        _setOption: function (e, t) {
            if (e === "culture" || e === "numberFormat") {
                var n = this._parse(this.element.val());
                this.options[e] = t, this.element.val(this._format(n));
                return
            }(e === "max" || e === "min" || e === "step") && typeof t == "string" && (t = this._parse(t)), e === "icons" && (this.buttons.first().find(".ui-icon").removeClass(this.options.icons.up).addClass(t.up), this.buttons.last().find(".ui-icon").removeClass(this.options.icons.down).addClass(t.down)), this._super(e, t), e === "disabled" && (t ? (this.element.prop("disabled", !0), this.buttons.button("disable")) : (this.element.prop("disabled", !1), this.buttons.button("enable")))
        },
        _setOptions: t(function (e) {
            this._super(e), this._value(this.element.val())
        }),
        _parse: function (e) {
            return typeof e == "string" && e !== "" && (e = window.Globalize && this.options.numberFormat ? Globalize.parseFloat(e, 10, this.options.culture) : +e), e === "" || isNaN(e) ? null : e
        },
        _format: function (e) {
            return e === "" ? "" : window.Globalize && this.options.numberFormat ? Globalize.format(e, this.options.numberFormat, this.options.culture) : e
        },
        _refresh: function () {
            this.element.attr({
                "aria-valuemin": this.options.min,
                "aria-valuemax": this.options.max,
                "aria-valuenow": this._parse(this.element.val())
            })
        },
        _value: function (e, t) {
            var n;
            e !== "" && (n = this._parse(e), n !== null && (t || (n = this._adjustValue(n)), e = this._format(n))), this.element.val(e), this._refresh()
        },
        _destroy: function () {
            this.element.removeClass("ui-spinner-input").prop("disabled", !1).removeAttr("autocomplete").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"), this.uiSpinner.replaceWith(this.element)
        },
        stepUp: t(function (e) {
            this._stepUp(e)
        }),
        _stepUp: function (e) {
            this._start() && (this._spin((e || 1) * this.options.step), this._stop())
        },
        stepDown: t(function (e) {
            this._stepDown(e)
        }),
        _stepDown: function (e) {
            this._start() && (this._spin((e || 1) * -this.options.step), this._stop())
        },
        pageUp: t(function (e) {
            this._stepUp((e || 1) * this.options.page)
        }),
        pageDown: t(function (e) {
            this._stepDown((e || 1) * this.options.page)
        }),
        value: function (e) {
            if (!arguments.length) return this._parse(this.element.val());
            t(this._value).call(this, e)
        },
        widget: function () {
            return this.uiSpinner
        }
    })
}(jQuery),
function (e, t) {
    function i() {
        return ++n
    }

    function s(e) {
        return e.hash.length > 1 && decodeURIComponent(e.href.replace(r, "")) === decodeURIComponent(location.href.replace(r, ""))
    }
    var n = 0,
        r = /#.*$/;
    e.widget("ui.tabs", {
        version: "1.10.2",
        delay: 300,
        options: {
            active: null,
            collapsible: !1,
            event: "click",
            heightStyle: "content",
            hide: null,
            show: null,
            activate: null,
            beforeActivate: null,
            beforeLoad: null,
            load: null
        },
        _create: function () {
            var t = this,
                n = this.options;
            this.running = !1, this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all").toggleClass("ui-tabs-collapsible", n.collapsible).delegate(".ui-tabs-nav > li", "mousedown" + this.eventNamespace, function (t) {
                e(this).is(".ui-state-disabled") && t.preventDefault()
            }).delegate(".ui-tabs-anchor", "focus" + this.eventNamespace, function () {
                e(this).closest("li").is(".ui-state-disabled") && this.blur()
            }), this._processTabs(), n.active = this._initialActive(), e.isArray(n.disabled) && (n.disabled = e.unique(n.disabled.concat(e.map(this.tabs.filter(".ui-state-disabled"), function (e) {
                return t.tabs.index(e)
            }))).sort()), this.options.active !== !1 && this.anchors.length ? this.active = this._findActive(n.active) : this.active = e(), this._refresh(), this.active.length && this.load(n.active)
        },
        _initialActive: function () {
            var t = this.options.active,
                n = this.options.collapsible,
                r = location.hash.substring(1);
            if (t === null) {
                r && this.tabs.each(function (n, i) {
                    if (e(i).attr("aria-controls") === r) return t = n, !1
                }), t === null && (t = this.tabs.index(this.tabs.filter(".ui-tabs-active")));
                if (t === null || t === -1) t = this.tabs.length ? 0 : !1
            }
            return t !== !1 && (t = this.tabs.index(this.tabs.eq(t)), t === -1 && (t = n ? !1 : 0)), !n && t === !1 && this.anchors.length && (t = 0), t
        },
        _getCreateEventData: function () {
            return {
                tab: this.active,
                panel: this.active.length ? this._getPanelForTab(this.active) : e()
            }
        },
        _tabKeydown: function (t) {
            var n = e(this.document[0].activeElement).closest("li"),
                r = this.tabs.index(n),
                i = !0;
            if (this._handlePageNav(t)) return;
            switch (t.keyCode) {
            case e.ui.keyCode.RIGHT:
            case e.ui.keyCode.DOWN:
                r++;
                break;
            case e.ui.keyCode.UP:
            case e.ui.keyCode.LEFT:
                i = !1, r--;
                break;
            case e.ui.keyCode.END:
                r = this.anchors.length - 1;
                break;
            case e.ui.keyCode.HOME:
                r = 0;
                break;
            case e.ui.keyCode.SPACE:
                t.preventDefault(), clearTimeout(this.activating), this._activate(r);
                return;
            case e.ui.keyCode.ENTER:
                t.preventDefault(), clearTimeout(this.activating), this._activate(r === this.options.active ? !1 : r);
                return;
            default:
                return
            }
            t.preventDefault(), clearTimeout(this.activating), r = this._focusNextTab(r, i), t.ctrlKey || (n.attr("aria-selected", "false"), this.tabs.eq(r).attr("aria-selected", "true"), this.activating = this._delay(function () {
                this.option("active", r)
            }, this.delay))
        },
        _panelKeydown: function (t) {
            if (this._handlePageNav(t)) return;
            t.ctrlKey && t.keyCode === e.ui.keyCode.UP && (t.preventDefault(), this.active.focus())
        },
        _handlePageNav: function (t) {
            if (t.altKey && t.keyCode === e.ui.keyCode.PAGE_UP) return this._activate(this._focusNextTab(this.options.active - 1, !1)), !0;
            if (t.altKey && t.keyCode === e.ui.keyCode.PAGE_DOWN) return this._activate(this._focusNextTab(this.options.active + 1, !0)), !0
        },
        _findNextTab: function (t, n) {
            function i() {
                return t > r && (t = 0), t < 0 && (t = r), t
            }
            var r = this.tabs.length - 1;
            while (e.inArray(i(), this.options.disabled) !== -1) t = n ? t + 1 : t - 1;
            return t
        },
        _focusNextTab: function (e, t) {
            return e = this._findNextTab(e, t), this.tabs.eq(e).focus(), e
        },
        _setOption: function (e, t) {
            if (e === "active") {
                this._activate(t);
                return
            }
            if (e === "disabled") {
                this._setupDisabled(t);
                return
            }
            this._super(e, t), e === "collapsible" && (this.element.toggleClass("ui-tabs-collapsible", t), !t && this.options.active === !1 && this._activate(0)), e === "event" && this._setupEvents(t), e === "heightStyle" && this._setupHeightStyle(t)
        },
        _tabId: function (e) {
            return e.attr("aria-controls") || "ui-tabs-" + i()
        },
        _sanitizeSelector: function (e) {
            return e ? e.replace(/[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g, "\\$&") : ""
        },
        refresh: function () {
            var t = this.options,
                n = this.tablist.children(":has(a[href])");
            t.disabled = e.map(n.filter(".ui-state-disabled"), function (e) {
                return n.index(e)
            }), this._processTabs(), t.active === !1 || !this.anchors.length ? (t.active = !1, this.active = e()) : this.active.length && !e.contains(this.tablist[0], this.active[0]) ? this.tabs.length === t.disabled.length ? (t.active = !1, this.active = e()) : this._activate(this._findNextTab(Math.max(0, t.active - 1), !1)) : t.active = this.tabs.index(this.active), this._refresh()
        },
        _refresh: function () {
            this._setupDisabled(this.options.disabled), this._setupEvents(this.options.event), this._setupHeightStyle(this.options.heightStyle), this.tabs.not(this.active).attr({
                "aria-selected": "false",
                tabIndex: -1
            }), this.panels.not(this._getPanelForTab(this.active)).hide().attr({
                "aria-expanded": "false",
                "aria-hidden": "true"
            }), this.active.length ? (this.active.addClass("ui-tabs-active ui-state-active").attr({
                "aria-selected": "true",
                tabIndex: 0
            }), this._getPanelForTab(this.active).show().attr({
                "aria-expanded": "true",
                "aria-hidden": "false"
            })) : this.tabs.eq(0).attr("tabIndex", 0)
        },
        _processTabs: function () {
            var t = this;
            this.tablist = this._getList().addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").attr("role", "tablist"), this.tabs = this.tablist.find("> li:has(a[href])").addClass("ui-state-default ui-corner-top").attr({
                role: "tab",
                tabIndex: -1
            }), this.anchors = this.tabs.map(function () {
                return e("a", this)[0]
            }).addClass("ui-tabs-anchor").attr({
                role: "presentation",
                tabIndex: -1
            }), this.panels = e(), this.anchors.each(function (n, r) {
                var i, o, u, a = e(r).uniqueId().attr("id"),
                    f = e(r).closest("li"),
                    l = f.attr("aria-controls");
                s(r) ? (i = r.hash, o = t.element.find(t._sanitizeSelector(i))) : (u = t._tabId(f), i = "#" + u, o = t.element.find(i), o.length || (o = t._createPanel(u), o.insertAfter(t.panels[n - 1] || t.tablist)), o.attr("aria-live", "polite")), o.length && (t.panels = t.panels.add(o)), l && f.data("ui-tabs-aria-controls", l), f.attr({
                    "aria-controls": i.substring(1),
                    "aria-labelledby": a
                }), o.attr("aria-labelledby", a)
            }), this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").attr("role", "tabpanel")
        },
        _getList: function () {
            return this.element.find("ol,ul").eq(0)
        },
        _createPanel: function (t) {
            return e("<div>").attr("id", t).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").data("ui-tabs-destroy", !0)
        },
        _setupDisabled: function (t) {
            e.isArray(t) && (t.length ? t.length === this.anchors.length && (t = !0) : t = !1);
            for (var n = 0, r; r = this.tabs[n]; n++) t === !0 || e.inArray(n, t) !== -1 ? e(r).addClass("ui-state-disabled").attr("aria-disabled", "true") : e(r).removeClass("ui-state-disabled").removeAttr("aria-disabled");
            this.options.disabled = t
        },
        _setupEvents: function (t) {
            var n = {
                click: function (e) {
                    e.preventDefault()
                }
            };
            t && e.each(t.split(" "), function (e, t) {
                n[t] = "_eventHandler"
            }), this._off(this.anchors.add(this.tabs).add(this.panels)), this._on(this.anchors, n), this._on(this.tabs, {
                keydown: "_tabKeydown"
            }), this._on(this.panels, {
                keydown: "_panelKeydown"
            }), this._focusable(this.tabs), this._hoverable(this.tabs)
        },
        _setupHeightStyle: function (t) {
            var n, r = this.element.parent();
            t === "fill" ? (n = r.height(), n -= this.element.outerHeight() - this.element.height(), this.element.siblings(":visible").each(function () {
                var t = e(this),
                    r = t.css("position");
                if (r === "absolute" || r === "fixed") return;
                n -= t.outerHeight(!0)
            }), this.element.children().not(this.panels).each(function () {
                n -= e(this).outerHeight(!0)
            }), this.panels.each(function () {
                e(this).height(Math.max(0, n - e(this).innerHeight() + e(this).height()))
            }).css("overflow", "auto")) : t === "auto" && (n = 0, this.panels.each(function () {
                n = Math.max(n, e(this).height("").height())
            }).height(n))
        },
        _eventHandler: function (t) {
            var n = this.options,
                r = this.active,
                i = e(t.currentTarget),
                s = i.closest("li"),
                o = s[0] === r[0],
                u = o && n.collapsible,
                a = u ? e() : this._getPanelForTab(s),
                f = r.length ? this._getPanelForTab(r) : e(),
                l = {
                    oldTab: r,
                    oldPanel: f,
                    newTab: u ? e() : s,
                    newPanel: a
                };
            t.preventDefault();
            if (s.hasClass("ui-state-disabled") || s.hasClass("ui-tabs-loading") || this.running || o && !n.collapsible || this._trigger("beforeActivate", t, l) === !1) return;
            n.active = u ? !1 : this.tabs.index(s), this.active = o ? e() : s, this.xhr && this.xhr.abort(), !f.length && !a.length && e.error("jQuery UI Tabs: Mismatching fragment identifier."), a.length && this.load(this.tabs.index(s), t), this._toggle(t, l)
        },
        _toggle: function (t, n) {
            function o() {
                r.running = !1, r._trigger("activate", t, n)
            }

            function u() {
                n.newTab.closest("li").addClass("ui-tabs-active ui-state-active"), i.length && r.options.show ? r._show(i, r.options.show, o) : (i.show(), o())
            }
            var r = this,
                i = n.newPanel,
                s = n.oldPanel;
            this.running = !0, s.length && this.options.hide ? this._hide(s, this.options.hide, function () {
                n.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"), u()
            }) : (n.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"), s.hide(), u()), s.attr({
                "aria-expanded": "false",
                "aria-hidden": "true"
            }), n.oldTab.attr("aria-selected", "false"), i.length && s.length ? n.oldTab.attr("tabIndex", -1) : i.length && this.tabs.filter(function () {
                return e(this).attr("tabIndex") === 0
            }).attr("tabIndex", -1), i.attr({
                "aria-expanded": "true",
                "aria-hidden": "false"
            }), n.newTab.attr({
                "aria-selected": "true",
                tabIndex: 0
            })
        },
        _activate: function (t) {
            var n, r = this._findActive(t);
            if (r[0] === this.active[0]) return;
            r.length || (r = this.active), n = r.find(".ui-tabs-anchor")[0], this._eventHandler({
                target: n,
                currentTarget: n,
                preventDefault: e.noop
            })
        },
        _findActive: function (t) {
            return t === !1 ? e() : this.tabs.eq(t)
        },
        _getIndex: function (e) {
            return typeof e == "string" && (e = this.anchors.index(this.anchors.filter("[href$='" + e + "']"))), e
        },
        _destroy: function () {
            this.xhr && this.xhr.abort(), this.element.removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible"), this.tablist.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").removeAttr("role"), this.anchors.removeClass("ui-tabs-anchor").removeAttr("role").removeAttr("tabIndex").removeUniqueId(), this.tabs.add(this.panels).each(function () {
                e.data(this, "ui-tabs-destroy") ? e(this).remove() : e(this).removeClass("ui-state-default ui-state-active ui-state-disabled ui-corner-top ui-corner-bottom ui-widget-content ui-tabs-active ui-tabs-panel").removeAttr("tabIndex").removeAttr("aria-live").removeAttr("aria-busy").removeAttr("aria-selected").removeAttr("aria-labelledby").removeAttr("aria-hidden").removeAttr("aria-expanded").removeAttr("role")
            }), this.tabs.each(function () {
                var t = e(this),
                    n = t.data("ui-tabs-aria-controls");
                n ? t.attr("aria-controls", n).removeData("ui-tabs-aria-controls") : t.removeAttr("aria-controls")
            }), this.panels.show(), this.options.heightStyle !== "content" && this.panels.css("height", "")
        },
        enable: function (n) {
            var r = this.options.disabled;
            if (r === !1) return;
            n === t ? r = !1 : (n = this._getIndex(n), e.isArray(r) ? r = e.map(r, function (e) {
                return e !== n ? e : null
            }) : r = e.map(this.tabs, function (e, t) {
                return t !== n ? t : null
            })), this._setupDisabled(r)
        },
        disable: function (n) {
            var r = this.options.disabled;
            if (r === !0) return;
            if (n === t) r = !0;
            else {
                n = this._getIndex(n);
                if (e.inArray(n, r) !== -1) return;
                e.isArray(r) ? r = e.merge([n], r).sort() : r = [n]
            }
            this._setupDisabled(r)
        },
        load: function (t, n) {
            t = this._getIndex(t);
            var r = this,
                i = this.tabs.eq(t),
                o = i.find(".ui-tabs-anchor"),
                u = this._getPanelForTab(i),
                a = {
                    tab: i,
                    panel: u
                };
            if (s(o[0])) return;
            this.xhr = e.ajax(this._ajaxSettings(o, n, a)), this.xhr && this.xhr.statusText !== "canceled" && (i.addClass("ui-tabs-loading"), u.attr("aria-busy", "true"), this.xhr.success(function (e) {
                setTimeout(function () {
                    u.html(e), r._trigger("load", n, a)
                }, 1)
            }).complete(function (e, t) {
                setTimeout(function () {
                    t === "abort" && r.panels.stop(!1, !0), i.removeClass("ui-tabs-loading"), u.removeAttr("aria-busy"), e === r.xhr && delete r.xhr
                }, 1)
            }))
        },
        _ajaxSettings: function (t, n, r) {
            var i = this;
            return {
                url: t.attr("href"),
                beforeSend: function (t, s) {
                    return i._trigger("beforeLoad", n, e.extend({
                        jqXHR: t,
                        ajaxSettings: s
                    }, r))
                }
            }
        },
        _getPanelForTab: function (t) {
            var n = e(t).attr("aria-controls");
            return this.element.find(this._sanitizeSelector("#" + n))
        }
    })
}(jQuery),
function (e) {
    function n(t, n) {
        var r = (t.attr("aria-describedby") || "").split(/\s+/);
        r.push(n), t.data("ui-tooltip-id", n).attr("aria-describedby", e.trim(r.join(" ")))
    }

    function r(t) {
        var n = t.data("ui-tooltip-id"),
            r = (t.attr("aria-describedby") || "").split(/\s+/),
            i = e.inArray(n, r);
        i !== -1 && r.splice(i, 1), t.removeData("ui-tooltip-id"), r = e.trim(r.join(" ")), r ? t.attr("aria-describedby", r) : t.removeAttr("aria-describedby")
    }
    var t = 0;
    e.widget("ui.tooltip", {
        version: "1.10.2",
        options: {
            content: function () {
                var t = e(this).attr("title") || "";
                return e("<a>").text(t).html()
            },
            hide: !0,
            items: "[title]:not([disabled])",
            position: {
                my: "left top+15",
                at: "left bottom",
                collision: "flipfit flip"
            },
            show: !0,
            tooltipClass: null,
            track: !1,
            close: null,
            open: null
        },
        _create: function () {
            this._on({
                mouseover: "open",
                focusin: "open"
            }), this.tooltips = {}, this.parents = {}, this.options.disabled && this._disable()
        },
        _setOption: function (t, n) {
            var r = this;
            if (t === "disabled") {
                this[n ? "_disable" : "_enable"](), this.options[t] = n;
                return
            }
            this._super(t, n), t === "content" && e.each(this.tooltips, function (e, t) {
                r._updateContent(t)
            })
        },
        _disable: function () {
            var t = this;
            e.each(this.tooltips, function (n, r) {
                var i = e.Event("blur");
                i.target = i.currentTarget = r[0], t.close(i, !0)
            }), this.element.find(this.options.items).addBack().each(function () {
                var t = e(this);
                t.is("[title]") && t.data("ui-tooltip-title", t.attr("title")).attr("title", "")
            })
        },
        _enable: function () {
            this.element.find(this.options.items).addBack().each(function () {
                var t = e(this);
                t.data("ui-tooltip-title") && t.attr("title", t.data("ui-tooltip-title"))
            })
        },
        open: function (t) {
            var n = this,
                r = e(t ? t.target : this.element).closest(this.options.items);
            if (!r.length || r.data("ui-tooltip-id")) return;
            r.attr("title") && r.data("ui-tooltip-title", r.attr("title")), r.data("ui-tooltip-open", !0), t && t.type === "mouseover" && r.parents().each(function () {
                var t = e(this),
                    r;
                t.data("ui-tooltip-open") && (r = e.Event("blur"), r.target = r.currentTarget = this, n.close(r, !0)), t.attr("title") && (t.uniqueId(), n.parents[this.id] = {
                    element: this,
                    title: t.attr("title")
                }, t.attr("title", ""))
            }), this._updateContent(r, t)
        },
        _updateContent: function (e, t) {
            var n, r = this.options.content,
                i = this,
                s = t ? t.type : null;
            if (typeof r == "string") return this._open(t, e, r);
            n = r.call(e[0], function (n) {
                if (!e.data("ui-tooltip-open")) return;
                i._delay(function () {
                    t && (t.type = s), this._open(t, e, n)
                })
            }), n && this._open(t, e, n)
        },
        _open: function (t, r, i) {
            function f(e) {
                a.of = e;
                if (s.is(":hidden")) return;
                s.position(a)
            }
            var s, o, u, a = e.extend({}, this.options.position);
            if (!i) return;
            s = this._find(r);
            if (s.length) {
                s.find(".ui-tooltip-content").html(i);
                return
            }
            r.is("[title]") && (t && t.type === "mouseover" ? r.attr("title", "") : r.removeAttr("title")), s = this._tooltip(r), n(r, s.attr("id")), s.find(".ui-tooltip-content").html(i), this.options.track && t && /^mouse/.test(t.type) ? (this._on(this.document, {
                mousemove: f
            }), f(t)) : s.position(e.extend({
                of: r
            }, this.options.position)), s.hide(), this._show(s, this.options.show), this.options.show && this.options.show.delay && (u = this.delayedShow = setInterval(function () {
                s.is(":visible") && (f(a.of), clearInterval(u))
            }, e.fx.interval)), this._trigger("open", t, {
                tooltip: s
            }), o = {
                keyup: function (t) {
                    if (t.keyCode === e.ui.keyCode.ESCAPE) {
                        var n = e.Event(t);
                        n.currentTarget = r[0], this.close(n, !0)
                    }
                },
                remove: function () {
                    this._removeTooltip(s)
                }
            };
            if (!t || t.type === "mouseover") o.mouseleave = "close";
            if (!t || t.type === "focusin") o.focusout = "close";
            this._on(!0, r, o)
        },
        close: function (t) {
            var n = this,
                i = e(t ? t.currentTarget : this.element),
                s = this._find(i);
            if (this.closing) return;
            clearInterval(this.delayedShow), i.data("ui-tooltip-title") && i.attr("title", i.data("ui-tooltip-title")), r(i), s.stop(!0), this._hide(s, this.options.hide, function () {
                n._removeTooltip(e(this))
            }), i.removeData("ui-tooltip-open"), this._off(i, "mouseleave focusout keyup"), i[0] !== this.element[0] && this._off(i, "remove"), this._off(this.document, "mousemove"), t && t.type === "mouseleave" && e.each(this.parents, function (t, r) {
                e(r.element).attr("title", r.title), delete n.parents[t]
            }), this.closing = !0, this._trigger("close", t, {
                tooltip: s
            }), this.closing = !1
        },
        _tooltip: function (n) {
            var r = "ui-tooltip-" + t++,
                i = e("<div>").attr({
                    id: r,
                    role: "tooltip"
                }).addClass("ui-tooltip ui-widget ui-corner-all ui-widget-content " + (this.options.tooltipClass || ""));
            return e("<div>").addClass("ui-tooltip-content").appendTo(i), i.appendTo(this.document[0].body), this.tooltips[r] = n, i
        },
        _find: function (t) {
            var n = t.data("ui-tooltip-id");
            return n ? e("#" + n) : e()
        },
        _removeTooltip: function (e) {
            e.remove(), delete this.tooltips[e.attr("id")]
        },
        _destroy: function () {
            var t = this;
            e.each(this.tooltips, function (n, r) {
                var i = e.Event("blur");
                i.target = i.currentTarget = r[0], t.close(i, !0), e("#" + n).remove(), r.data("ui-tooltip-title") && (r.attr("title", r.data("ui-tooltip-title")), r.removeData("ui-tooltip-title"))
            })
        }
    })
}(jQuery),
function (e, t) {
    var n = "ui-effects-";
    e.effects = {
        effect: {}
    },
    function (e, t) {
        function h(e, t, n) {
            var r = u[t.type] || {};
            return e == null ? n || !t.def ? null : t.def : (e = r.floor ? ~~e : parseFloat(e), isNaN(e) ? t.def : r.mod ? (e + r.mod) % r.mod : 0 > e ? 0 : r.max < e ? r.max : e)
        }

        function p(t) {
            var n = s(),
                r = n._rgba = [];
            return t = t.toLowerCase(), c(i, function (e, i) {
                var s, u = i.re.exec(t),
                    a = u && i.parse(u),
                    f = i.space || "rgba";
                if (a) return s = n[f](a), n[o[f].cache] = s[o[f].cache], r = n._rgba = s._rgba, !1
            }),
            r.length ? (r.join() === "0,0,0,0" && e.extend(r, l.transparent), n) : l[t]
        }

        function d(e, t, n) {
            return n = (n + 1) % 1, n * 6 < 1 ? e + (t - e) * n * 6 : n * 2 < 1 ? t : n * 3 < 2 ? e + (t - e) * (2 / 3 - n) * 6 : e
        }
        var n = "backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor",
            r = /^([\-+])=\s*(\d+\.?\d*)/,
            i = [{
                re: /rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,
                parse: function (e) {
                    return [e[1], e[2], e[3], e[4]]
                }
            }, {
                re: /rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,
                parse: function (e) {
                    return [e[1] * 2.55, e[2] * 2.55, e[3] * 2.55, e[4]]
                }
            }, {
                re: /#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,
                parse: function (e) {
                    return [parseInt(e[1], 16), parseInt(e[2], 16), parseInt(e[3], 16)]
                }
            }, {
                re: /#([a-f0-9])([a-f0-9])([a-f0-9])/,
                parse: function (e) {
                    return [parseInt(e[1] + e[1], 16), parseInt(e[2] + e[2], 16), parseInt(e[3] + e[3], 16)]
                }
            }, {
                re: /hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,
                space: "hsla",
                parse: function (e) {
                    return [e[1], e[2] / 100, e[3] / 100, e[4]]
                }
            }],
            s = e.Color = function (t, n, r, i) {
                return new e.Color.fn.parse(t, n, r, i)
            }, o = {
                rgba: {
                    props: {
                        red: {
                            idx: 0,
                            type: "byte"
                        },
                        green: {
                            idx: 1,
                            type: "byte"
                        },
                        blue: {
                            idx: 2,
                            type: "byte"
                        }
                    }
                },
                hsla: {
                    props: {
                        hue: {
                            idx: 0,
                            type: "degrees"
                        },
                        saturation: {
                            idx: 1,
                            type: "percent"
                        },
                        lightness: {
                            idx: 2,
                            type: "percent"
                        }
                    }
                }
            }, u = {
                "byte": {
                    floor: !0,
                    max: 255
                },
                percent: {
                    max: 1
                },
                degrees: {
                    mod: 360,
                    floor: !0
                }
            }, a = s.support = {}, f = e("<p>")[0],
            l, c = e.each;
        f.style.cssText = "background-color:rgba(1,1,1,.5)", a.rgba = f.style.backgroundColor.indexOf("rgba") > -1, c(o, function (e, t) {
            t.cache = "_" + e, t.props.alpha = {
                idx: 3,
                type: "percent",
                def: 1
            }
        }), s.fn = e.extend(s.prototype, {
            parse: function (n, r, i, u) {
                if (n === t) return this._rgba = [null, null, null, null], this;
                if (n.jquery || n.nodeType) n = e(n).css(r), r = t;
                var a = this,
                    f = e.type(n),
                    d = this._rgba = [];
                r !== t && (n = [n, r, i, u], f = "array");
                if (f === "string") return this.parse(p(n) || l._default);
                if (f === "array") return c(o.rgba.props, function (e, t) {
                    d[t.idx] = h(n[t.idx], t)
                }), this;
                if (f === "object") return n instanceof s ? c(o, function (e, t) {
                    n[t.cache] && (a[t.cache] = n[t.cache].slice())
                }) : c(o, function (t, r) {
                    var i = r.cache;
                    c(r.props, function (e, t) {
                        if (!a[i] && r.to) {
                            if (e === "alpha" || n[e] == null) return;
                            a[i] = r.to(a._rgba)
                        }
                        a[i][t.idx] = h(n[e], t, !0)
                    }), a[i] && e.inArray(null, a[i].slice(0, 3)) < 0 && (a[i][3] = 1, r.from && (a._rgba = r.from(a[i])))
                }), this
            },
            is: function (e) {
                var t = s(e),
                    n = !0,
                    r = this;
                return c(o, function (e, i) {
                    var s, o = t[i.cache];
                    return o && (s = r[i.cache] || i.to && i.to(r._rgba) || [], c(i.props, function (e, t) {
                        if (o[t.idx] != null) return n = o[t.idx] === s[t.idx], n
                    })), n
                }), n
            },
            _space: function () {
                var e = [],
                    t = this;
                return c(o, function (n, r) {
                    t[r.cache] && e.push(n)
                }), e.pop()
            },
            transition: function (e, t) {
                var n = s(e),
                    r = n._space(),
                    i = o[r],
                    a = this.alpha() === 0 ? s("transparent") : this,
                    f = a[i.cache] || i.to(a._rgba),
                    l = f.slice();
                return n = n[i.cache], c(i.props, function (e, r) {
                    var i = r.idx,
                        s = f[i],
                        o = n[i],
                        a = u[r.type] || {};
                    if (o === null) return;
                    s === null ? l[i] = o : (a.mod && (o - s > a.mod / 2 ? s += a.mod : s - o > a.mod / 2 && (s -= a.mod)), l[i] = h((o - s) * t + s, r))
                }), this[r](l)
            },
            blend: function (t) {
                if (this._rgba[3] === 1) return this;
                var n = this._rgba.slice(),
                    r = n.pop(),
                    i = s(t)._rgba;
                return s(e.map(n, function (e, t) {
                    return (1 - r) * i[t] + r * e
                }))
            },
            toRgbaString: function () {
                var t = "rgba(",
                    n = e.map(this._rgba, function (e, t) {
                        return e == null ? t > 2 ? 1 : 0 : e
                    });
                return n[3] === 1 && (n.pop(), t = "rgb("), t + n.join() + ")"
            },
            toHslaString: function () {
                var t = "hsla(",
                    n = e.map(this.hsla(), function (e, t) {
                        return e == null && (e = t > 2 ? 1 : 0), t && t < 3 && (e = Math.round(e * 100) + "%"), e
                    });
                return n[3] === 1 && (n.pop(), t = "hsl("), t + n.join() + ")"
            },
            toHexString: function (t) {
                var n = this._rgba.slice(),
                    r = n.pop();
                return t && n.push(~~(r * 255)), "#" + e.map(n, function (e) {
                    return e = (e || 0).toString(16), e.length === 1 ? "0" + e : e
                }).join("")
            },
            toString: function () {
                return this._rgba[3] === 0 ? "transparent" : this.toRgbaString()
            }
        }), s.fn.parse.prototype = s.fn, o.hsla.to = function (e) {
            if (e[0] == null || e[1] == null || e[2] == null) return [null, null, null, e[3]];
            var t = e[0] / 255,
                n = e[1] / 255,
                r = e[2] / 255,
                i = e[3],
                s = Math.max(t, n, r),
                o = Math.min(t, n, r),
                u = s - o,
                a = s + o,
                f = a * .5,
                l, c;
            return o === s ? l = 0 : t === s ? l = 60 * (n - r) / u + 360 : n === s ? l = 60 * (r - t) / u + 120 : l = 60 * (t - n) / u + 240, u === 0 ? c = 0 : f <= .5 ? c = u / a : c = u / (2 - a), [Math.round(l) % 360, c, f, i == null ? 1 : i]
        }, o.hsla.from = function (e) {
            if (e[0] == null || e[1] == null || e[2] == null) return [null, null, null, e[3]];
            var t = e[0] / 360,
                n = e[1],
                r = e[2],
                i = e[3],
                s = r <= .5 ? r * (1 + n) : r + n - r * n,
                o = 2 * r - s;
            return [Math.round(d(o, s, t + 1 / 3) * 255), Math.round(d(o, s, t) * 255), Math.round(d(o, s, t - 1 / 3) * 255), i]
        }, c(o, function (n, i) {
            var o = i.props,
                u = i.cache,
                a = i.to,
                f = i.from;
            s.fn[n] = function (n) {
                a && !this[u] && (this[u] = a(this._rgba));
                if (n === t) return this[u].slice();
                var r, i = e.type(n),
                    l = i === "array" || i === "object" ? n : arguments,
                    p = this[u].slice();
                return c(o, function (e, t) {
                    var n = l[i === "object" ? e : t.idx];
                    n == null && (n = p[t.idx]), p[t.idx] = h(n, t)
                }), f ? (r = s(f(p)), r[u] = p, r) : s(p)
            }, c(o, function (t, i) {
                if (s.fn[t]) return;
                s.fn[t] = function (s) {
                    var o = e.type(s),
                        u = t === "alpha" ? this._hsla ? "hsla" : "rgba" : n,
                        a = this[u](),
                        f = a[i.idx],
                        l;
                    return o === "undefined" ? f : (o === "function" && (s = s.call(this, f), o = e.type(s)), s == null && i.empty ? this : (o === "string" && (l = r.exec(s), l && (s = f + parseFloat(l[2]) * (l[1] === "+" ? 1 : -1))), a[i.idx] = s, this[u](a)))
                }
            })
        }), s.hook = function (t) {
            var n = t.split(" ");
            c(n, function (t, n) {
                e.cssHooks[n] = {
                    set: function (t, r) {
                        var i, o, u = "";
                        if (r !== "transparent" && (e.type(r) !== "string" || (i = p(r)))) {
                            r = s(i || r);
                            if (!a.rgba && r._rgba[3] !== 1) {
                                o = n === "backgroundColor" ? t.parentNode : t;
                                while ((u === "" || u === "transparent") && o && o.style) try {
                                    u = e.css(o, "backgroundColor"), o = o.parentNode
                                } catch (f) {}
                                r = r.blend(u && u !== "transparent" ? u : "_default")
                            }
                            r = r.toRgbaString()
                        }
                        try {
                            t.style[n] = r
                        } catch (f) {}
                    }
                }, e.fx.step[n] = function (t) {
                    t.colorInit || (t.start = s(t.elem, n), t.end = s(t.end), t.colorInit = !0), e.cssHooks[n].set(t.elem, t.start.transition(t.end, t.pos))
                }
            })
        }, s.hook(n), e.cssHooks.borderColor = {
            expand: function (e) {
                var t = {};
                return c(["Top", "Right", "Bottom", "Left"], function (n, r) {
                    t["border" + r + "Color"] = e
                }), t
            }
        }, l = e.Color.names = {
            aqua: "#00ffff",
            black: "#000000",
            blue: "#0000ff",
            fuchsia: "#ff00ff",
            gray: "#808080",
            green: "#008000",
            lime: "#00ff00",
            maroon: "#800000",
            navy: "#000080",
            olive: "#808000",
            purple: "#800080",
            red: "#ff0000",
            silver: "#c0c0c0",
            teal: "#008080",
            white: "#ffffff",
            yellow: "#ffff00",
            transparent: [null, null, null, 0],
            _default: "#ffffff"
        }
    }(jQuery),
    function () {
        function i(t) {
            var n, r, i = t.ownerDocument.defaultView ? t.ownerDocument.defaultView.getComputedStyle(t, null) : t.currentStyle,
                s = {};
            if (i && i.length && i[0] && i[i[0]]) {
                r = i.length;
                while (r--) n = i[r], typeof i[n] == "string" && (s[e.camelCase(n)] = i[n])
            } else
                for (n in i) typeof i[n] == "string" && (s[n] = i[n]);
            return s
        }

        function s(t, n) {
            var i = {}, s, o;
            for (s in n) o = n[s], t[s] !== o && !r[s] && (e.fx.step[s] || !isNaN(parseFloat(o))) && (i[s] = o);
            return i
        }
        var n = ["add", "remove", "toggle"],
            r = {
                border: 1,
                borderBottom: 1,
                borderColor: 1,
                borderLeft: 1,
                borderRight: 1,
                borderTop: 1,
                borderWidth: 1,
                margin: 1,
                padding: 1
            };
        e.each(["borderLeftStyle", "borderRightStyle", "borderBottomStyle", "borderTopStyle"], function (t, n) {
            e.fx.step[n] = function (e) {
                if (e.end !== "none" && !e.setAttr || e.pos === 1 && !e.setAttr) jQuery.style(e.elem, n, e.end), e.setAttr = !0
            }
        }), e.fn.addBack || (e.fn.addBack = function (e) {
            return this.add(e == null ? this.prevObject : this.prevObject.filter(e))
        }), e.effects.animateClass = function (t, r, o, u) {
            var a = e.speed(r, o, u);
            return this.queue(function () {
                var r = e(this),
                    o = r.attr("class") || "",
                    u, f = a.children ? r.find("*").addBack() : r;
                f = f.map(function () {
                    var t = e(this);
                    return {
                        el: t,
                        start: i(this)
                    }
                }), u = function () {
                    e.each(n, function (e, n) {
                        t[n] && r[n + "Class"](t[n])
                    })
                }, u(), f = f.map(function () {
                    return this.end = i(this.el[0]), this.diff = s(this.start, this.end), this
                }), r.attr("class", o), f = f.map(function () {
                    var t = this,
                        n = e.Deferred(),
                        r = e.extend({}, a, {
                            queue: !1,
                            complete: function () {
                                n.resolve(t)
                            }
                        });
                    return this.el.animate(this.diff, r), n.promise()
                }), e.when.apply(e, f.get()).done(function () {
                    u(), e.each(arguments, function () {
                        var t = this.el;
                        e.each(this.diff, function (e) {
                            t.css(e, "")
                        })
                    }), a.complete.call(r[0])
                })
            })
        }, e.fn.extend({
            addClass: function (t) {
                return function (n, r, i, s) {
                    return r ? e.effects.animateClass.call(this, {
                        add: n
                    }, r, i, s) : t.apply(this, arguments)
                }
            }(e.fn.addClass),
            removeClass: function (t) {
                return function (n, r, i, s) {
                    return arguments.length > 1 ? e.effects.animateClass.call(this, {
                        remove: n
                    }, r, i, s) : t.apply(this, arguments)
                }
            }(e.fn.removeClass),
            toggleClass: function (n) {
                return function (r, i, s, o, u) {
                    return typeof i == "boolean" || i === t ? s ? e.effects.animateClass.call(this, i ? {
                        add: r
                    } : {
                        remove: r
                    }, s, o, u) : n.apply(this, arguments) : e.effects.animateClass.call(this, {
                        toggle: r
                    }, i, s, o)
                }
            }(e.fn.toggleClass),
            switchClass: function (t, n, r, i, s) {
                return e.effects.animateClass.call(this, {
                    add: n,
                    remove: t
                }, r, i, s)
            }
        })
    }(),
    function () {
        function r(t, n, r, i) {
            e.isPlainObject(t) && (n = t, t = t.effect), t = {
                effect: t
            }, n == null && (n = {}), e.isFunction(n) && (i = n, r = null, n = {});
            if (typeof n == "number" || e.fx.speeds[n]) i = r, r = n, n = {};
            return e.isFunction(r) && (i = r, r = null), n && e.extend(t, n), r = r || n.duration, t.duration = e.fx.off ? 0 : typeof r == "number" ? r : r in e.fx.speeds ? e.fx.speeds[r] : e.fx.speeds._default, t.complete = i || n.complete, t
        }

        function i(t) {
            return !t || typeof t == "number" || e.fx.speeds[t] ? !0 : typeof t == "string" && !e.effects.effect[t] ? !0 : e.isFunction(t) ? !0 : typeof t == "object" && !t.effect ? !0 : !1
        }
        e.extend(e.effects, {
            version: "1.10.2",
            save: function (e, t) {
                for (var r = 0; r < t.length; r++) t[r] !== null && e.data(n + t[r], e[0].style[t[r]])
            },
            restore: function (e, r) {
                var i, s;
                for (s = 0; s < r.length; s++) r[s] !== null && (i = e.data(n + r[s]), i === t && (i = ""), e.css(r[s], i))
            },
            setMode: function (e, t) {
                return t === "toggle" && (t = e.is(":hidden") ? "show" : "hide"), t
            },
            getBaseline: function (e, t) {
                var n, r;
                switch (e[0]) {
                case "top":
                    n = 0;
                    break;
                case "middle":
                    n = .5;
                    break;
                case "bottom":
                    n = 1;
                    break;
                default:
                    n = e[0] / t.height
                }
                switch (e[1]) {
                case "left":
                    r = 0;
                    break;
                case "center":
                    r = .5;
                    break;
                case "right":
                    r = 1;
                    break;
                default:
                    r = e[1] / t.width
                }
                return {
                    x: r,
                    y: n
                }
            },
            createWrapper: function (t) {
                if (t.parent().is(".ui-effects-wrapper")) return t.parent();
                var n = {
                    width: t.outerWidth(!0),
                    height: t.outerHeight(!0),
                    "float": t.css("float")
                }, r = e("<div></div>").addClass("ui-effects-wrapper").css({
                        fontSize: "100%",
                        background: "transparent",
                        border: "none",
                        margin: 0,
                        padding: 0
                    }),
                    i = {
                        width: t.width(),
                        height: t.height()
                    }, s = document.activeElement;
                try {
                    s.id
                } catch (o) {
                    s = document.body
                }
                return t.wrap(r), (t[0] === s || e.contains(t[0], s)) && e(s).focus(), r = t.parent(), t.css("position") === "static" ? (r.css({
                    position: "relative"
                }), t.css({
                    position: "relative"
                })) : (e.extend(n, {
                    position: t.css("position"),
                    zIndex: t.css("z-index")
                }), e.each(["top", "left", "bottom", "right"], function (e, r) {
                    n[r] = t.css(r), isNaN(parseInt(n[r], 10)) && (n[r] = "auto")
                }), t.css({
                    position: "relative",
                    top: 0,
                    left: 0,
                    right: "auto",
                    bottom: "auto"
                })), t.css(i), r.css(n).show()
            },
            removeWrapper: function (t) {
                var n = document.activeElement;
                return t.parent().is(".ui-effects-wrapper") && (t.parent().replaceWith(t), (t[0] === n || e.contains(t[0], n)) && e(n).focus()), t
            },
            setTransition: function (t, n, r, i) {
                return i = i || {}, e.each(n, function (e, n) {
                    var s = t.cssUnit(n);
                    s[0] > 0 && (i[n] = s[0] * r + s[1])
                }), i
            }
        }), e.fn.extend({
            effect: function () {
                function o(n) {
                    function u() {
                        e.isFunction(i) && i.call(r[0]), e.isFunction(n) && n()
                    }
                    var r = e(this),
                        i = t.complete,
                        o = t.mode;
                    (r.is(":hidden") ? o === "hide" : o === "show") ? (r[o](), u()) : s.call(r[0], t, u)
                }
                var t = r.apply(this, arguments),
                    n = t.mode,
                    i = t.queue,
                    s = e.effects.effect[t.effect];
                return e.fx.off || !s ? n ? this[n](t.duration, t.complete) : this.each(function () {
                    t.complete && t.complete.call(this)
                }) : i === !1 ? this.each(o) : this.queue(i || "fx", o)
            },
            show: function (e) {
                return function (t) {
                    if (i(t)) return e.apply(this, arguments);
                    var n = r.apply(this, arguments);
                    return n.mode = "show", this.effect.call(this, n)
                }
            }(e.fn.show),
            hide: function (e) {
                return function (t) {
                    if (i(t)) return e.apply(this, arguments);
                    var n = r.apply(this, arguments);
                    return n.mode = "hide", this.effect.call(this, n)
                }
            }(e.fn.hide),
            toggle: function (e) {
                return function (t) {
                    if (i(t) || typeof t == "boolean") return e.apply(this, arguments);
                    var n = r.apply(this, arguments);
                    return n.mode = "toggle", this.effect.call(this, n)
                }
            }(e.fn.toggle),
            cssUnit: function (t) {
                var n = this.css(t),
                    r = [];
                return e.each(["em", "px", "%", "pt"], function (e, t) {
                    n.indexOf(t) > 0 && (r = [parseFloat(n), t])
                }), r
            }
        })
    }(),
    function () {
        var t = {};
        e.each(["Quad", "Cubic", "Quart", "Quint", "Expo"], function (e, n) {
            t[n] = function (t) {
                return Math.pow(t, e + 2)
            }
        }), e.extend(t, {
            Sine: function (e) {
                return 1 - Math.cos(e * Math.PI / 2)
            },
            Circ: function (e) {
                return 1 - Math.sqrt(1 - e * e)
            },
            Elastic: function (e) {
                return e === 0 || e === 1 ? e : -Math.pow(2, 8 * (e - 1)) * Math.sin(((e - 1) * 80 - 7.5) * Math.PI / 15)
            },
            Back: function (e) {
                return e * e * (3 * e - 2)
            },
            Bounce: function (e) {
                var t, n = 4;
                while (e < ((t = Math.pow(2, --n)) - 1) / 11);
                return 1 / Math.pow(4, 3 - n) - 7.5625 * Math.pow((t * 3 - 2) / 22 - e, 2)
            }
        }), e.each(t, function (t, n) {
            e.easing["easeIn" + t] = n, e.easing["easeOut" + t] = function (e) {
                return 1 - n(1 - e)
            }, e.easing["easeInOut" + t] = function (e) {
                return e < .5 ? n(e * 2) / 2 : 1 - n(e * -2 + 2) / 2
            }
        })
    }()
}(jQuery),
function (e, t) {
    var n = /up|down|vertical/,
        r = /up|left|vertical|horizontal/;
    e.effects.effect.blind = function (t, i) {
        var s = e(this),
            o = ["position", "top", "bottom", "left", "right", "height", "width"],
            u = e.effects.setMode(s, t.mode || "hide"),
            a = t.direction || "up",
            f = n.test(a),
            l = f ? "height" : "width",
            c = f ? "top" : "left",
            h = r.test(a),
            p = {}, d = u === "show",
            v, m, g;
        s.parent().is(".ui-effects-wrapper") ? e.effects.save(s.parent(), o) : e.effects.save(s, o), s.show(), v = e.effects.createWrapper(s).css({
            overflow: "hidden"
        }), m = v[l](), g = parseFloat(v.css(c)) || 0, p[l] = d ? m : 0, h || (s.css(f ? "bottom" : "right", 0).css(f ? "top" : "left", "auto").css({
            position: "absolute"
        }), p[c] = d ? g : m + g), d && (v.css(l, 0), h || v.css(c, g + m)), v.animate(p, {
            duration: t.duration,
            easing: t.easing,
            queue: !1,
            complete: function () {
                u === "hide" && s.hide(), e.effects.restore(s, o), e.effects.removeWrapper(s), i()
            }
        })
    }
}(jQuery),
function (e, t) {
    e.effects.effect.bounce = function (t, n) {
        var r = e(this),
            i = ["position", "top", "bottom", "left", "right", "height", "width"],
            s = e.effects.setMode(r, t.mode || "effect"),
            o = s === "hide",
            u = s === "show",
            a = t.direction || "up",
            f = t.distance,
            l = t.times || 5,
            c = l * 2 + (u || o ? 1 : 0),
            h = t.duration / c,
            p = t.easing,
            d = a === "up" || a === "down" ? "top" : "left",
            v = a === "up" || a === "left",
            m, g, y, b = r.queue(),
            w = b.length;
        (u || o) && i.push("opacity"), e.effects.save(r, i), r.show(), e.effects.createWrapper(r), f || (f = r[d === "top" ? "outerHeight" : "outerWidth"]() / 3), u && (y = {
                opacity: 1
            }, y[d] = 0, r.css("opacity", 0).css(d, v ? -f * 2 : f * 2).animate(y, h, p)), o && (f /= Math.pow(2, l - 1)), y = {}, y[d] = 0;
        for (m = 0; m < l; m++) g = {}, g[d] = (v ? "-=" : "+=") + f, r.animate(g, h, p).animate(y, h, p), f = o ? f * 2 : f / 2;
        o && (g = {
            opacity: 0
        }, g[d] = (v ? "-=" : "+=") + f, r.animate(g, h, p)), r.queue(function () {
            o && r.hide(), e.effects.restore(r, i), e.effects.removeWrapper(r), n()
        }), w > 1 && b.splice.apply(b, [1, 0].concat(b.splice(w, c + 1))), r.dequeue()
    }
}(jQuery),
function (e, t) {
    e.effects.effect.clip = function (t, n) {
        var r = e(this),
            i = ["position", "top", "bottom", "left", "right", "height", "width"],
            s = e.effects.setMode(r, t.mode || "hide"),
            o = s === "show",
            u = t.direction || "vertical",
            a = u === "vertical",
            f = a ? "height" : "width",
            l = a ? "top" : "left",
            c = {}, h, p, d;
        e.effects.save(r, i), r.show(), h = e.effects.createWrapper(r).css({
            overflow: "hidden"
        }), p = r[0].tagName === "IMG" ? h : r, d = p[f](), o && (p.css(f, 0), p.css(l, d / 2)), c[f] = o ? d : 0, c[l] = o ? 0 : d / 2, p.animate(c, {
            queue: !1,
            duration: t.duration,
            easing: t.easing,
            complete: function () {
                o || r.hide(), e.effects.restore(r, i), e.effects.removeWrapper(r), n()
            }
        })
    }
}(jQuery),
function (e, t) {
    e.effects.effect.drop = function (t, n) {
        var r = e(this),
            i = ["position", "top", "bottom", "left", "right", "opacity", "height", "width"],
            s = e.effects.setMode(r, t.mode || "hide"),
            o = s === "show",
            u = t.direction || "left",
            a = u === "up" || u === "down" ? "top" : "left",
            f = u === "up" || u === "left" ? "pos" : "neg",
            l = {
                opacity: o ? 1 : 0
            }, c;
        e.effects.save(r, i), r.show(), e.effects.createWrapper(r), c = t.distance || r[a === "top" ? "outerHeight" : "outerWidth"](!0) / 2, o && r.css("opacity", 0).css(a, f === "pos" ? -c : c), l[a] = (o ? f === "pos" ? "+=" : "-=" : f === "pos" ? "-=" : "+=") + c, r.animate(l, {
            queue: !1,
            duration: t.duration,
            easing: t.easing,
            complete: function () {
                s === "hide" && r.hide(), e.effects.restore(r, i), e.effects.removeWrapper(r), n()
            }
        })
    }
}(jQuery),
function (e, t) {
    e.effects.effect.explode = function (t, n) {
        function y() {
            c.push(this), c.length === r * i && b()
        }

        function b() {
            s.css({
                visibility: "visible"
            }), e(c).remove(), u || s.hide(), n()
        }
        var r = t.pieces ? Math.round(Math.sqrt(t.pieces)) : 3,
            i = r,
            s = e(this),
            o = e.effects.setMode(s, t.mode || "hide"),
            u = o === "show",
            a = s.show().css("visibility", "hidden").offset(),
            f = Math.ceil(s.outerWidth() / i),
            l = Math.ceil(s.outerHeight() / r),
            c = [],
            h, p, d, v, m, g;
        for (h = 0; h < r; h++) {
            v = a.top + h * l, g = h - (r - 1) / 2;
            for (p = 0; p < i; p++) d = a.left + p * f, m = p - (i - 1) / 2, s.clone().appendTo("body").wrap("<div></div>").css({
                position: "absolute",
                visibility: "visible",
                left: -p * f,
                top: -h * l
            }).parent().addClass("ui-effects-explode").css({
                position: "absolute",
                overflow: "hidden",
                width: f,
                height: l,
                left: d + (u ? m * f : 0),
                top: v + (u ? g * l : 0),
                opacity: u ? 0 : 1
            }).animate({
                left: d + (u ? 0 : m * f),
                top: v + (u ? 0 : g * l),
                opacity: u ? 1 : 0
            }, t.duration || 500, t.easing, y)
        }
    }
}(jQuery),
function (e, t) {
    e.effects.effect.fade = function (t, n) {
        var r = e(this),
            i = e.effects.setMode(r, t.mode || "toggle");
        r.animate({
            opacity: i
        }, {
            queue: !1,
            duration: t.duration,
            easing: t.easing,
            complete: n
        })
    }
}(jQuery),
function (e, t) {
    e.effects.effect.fold = function (t, n) {
        var r = e(this),
            i = ["position", "top", "bottom", "left", "right", "height", "width"],
            s = e.effects.setMode(r, t.mode || "hide"),
            o = s === "show",
            u = s === "hide",
            a = t.size || 15,
            f = /([0-9]+)%/.exec(a),
            l = !! t.horizFirst,
            c = o !== l,
            h = c ? ["width", "height"] : ["height", "width"],
            p = t.duration / 2,
            d, v, m = {}, g = {};
        e.effects.save(r, i), r.show(), d = e.effects.createWrapper(r).css({
            overflow: "hidden"
        }), v = c ? [d.width(), d.height()] : [d.height(), d.width()], f && (a = parseInt(f[1], 10) / 100 * v[u ? 0 : 1]), o && d.css(l ? {
            height: 0,
            width: a
        } : {
            height: a,
            width: 0
        }), m[h[0]] = o ? v[0] : a, g[h[1]] = o ? v[1] : 0, d.animate(m, p, t.easing).animate(g, p, t.easing, function () {
            u && r.hide(), e.effects.restore(r, i), e.effects.removeWrapper(r), n()
        })
    }
}(jQuery),
function (e, t) {
    e.effects.effect.highlight = function (t, n) {
        var r = e(this),
            i = ["backgroundImage", "backgroundColor", "opacity"],
            s = e.effects.setMode(r, t.mode || "show"),
            o = {
                backgroundColor: r.css("backgroundColor")
            };
        s === "hide" && (o.opacity = 0), e.effects.save(r, i), r.show().css({
            backgroundImage: "none",
            backgroundColor: t.color || "#ffff99"
        }).animate(o, {
            queue: !1,
            duration: t.duration,
            easing: t.easing,
            complete: function () {
                s === "hide" && r.hide(), e.effects.restore(r, i), n()
            }
        })
    }
}(jQuery),
function (e, t) {
    e.effects.effect.pulsate = function (t, n) {
        var r = e(this),
            i = e.effects.setMode(r, t.mode || "show"),
            s = i === "show",
            o = i === "hide",
            u = s || i === "hide",
            a = (t.times || 5) * 2 + (u ? 1 : 0),
            f = t.duration / a,
            l = 0,
            c = r.queue(),
            h = c.length,
            p;
        if (s || !r.is(":visible")) r.css("opacity", 0).show(), l = 1;
        for (p = 1; p < a; p++) r.animate({
            opacity: l
        }, f, t.easing), l = 1 - l;
        r.animate({
            opacity: l
        }, f, t.easing), r.queue(function () {
            o && r.hide(), n()
        }), h > 1 && c.splice.apply(c, [1, 0].concat(c.splice(h, a + 1))), r.dequeue()
    }
}(jQuery),
function (e, t) {
    e.effects.effect.puff = function (t, n) {
        var r = e(this),
            i = e.effects.setMode(r, t.mode || "hide"),
            s = i === "hide",
            o = parseInt(t.percent, 10) || 150,
            u = o / 100,
            a = {
                height: r.height(),
                width: r.width(),
                outerHeight: r.outerHeight(),
                outerWidth: r.outerWidth()
            };
        e.extend(t, {
            effect: "scale",
            queue: !1,
            fade: !0,
            mode: i,
            complete: n,
            percent: s ? o : 100,
            from: s ? a : {
                height: a.height * u,
                width: a.width * u,
                outerHeight: a.outerHeight * u,
                outerWidth: a.outerWidth * u
            }
        }), r.effect(t)
    }, e.effects.effect.scale = function (t, n) {
        var r = e(this),
            i = e.extend(!0, {}, t),
            s = e.effects.setMode(r, t.mode || "effect"),
            o = parseInt(t.percent, 10) || (parseInt(t.percent, 10) === 0 ? 0 : s === "hide" ? 0 : 100),
            u = t.direction || "both",
            a = t.origin,
            f = {
                height: r.height(),
                width: r.width(),
                outerHeight: r.outerHeight(),
                outerWidth: r.outerWidth()
            }, l = {
                y: u !== "horizontal" ? o / 100 : 1,
                x: u !== "vertical" ? o / 100 : 1
            };
        i.effect = "size", i.queue = !1, i.complete = n, s !== "effect" && (i.origin = a || ["middle", "center"], i.restore = !0), i.from = t.from || (s === "show" ? {
            height: 0,
            width: 0,
            outerHeight: 0,
            outerWidth: 0
        } : f), i.to = {
            height: f.height * l.y,
            width: f.width * l.x,
            outerHeight: f.outerHeight * l.y,
            outerWidth: f.outerWidth * l.x
        }, i.fade && (s === "show" && (i.from.opacity = 0, i.to.opacity = 1), s === "hide" && (i.from.opacity = 1, i.to.opacity = 0)), r.effect(i)
    }, e.effects.effect.size = function (t, n) {
        var r, i, s, o = e(this),
            u = ["position", "top", "bottom", "left", "right", "width", "height", "overflow", "opacity"],
            a = ["position", "top", "bottom", "left", "right", "overflow", "opacity"],
            f = ["width", "height", "overflow"],
            l = ["fontSize"],
            c = ["borderTopWidth", "borderBottomWidth", "paddingTop", "paddingBottom"],
            h = ["borderLeftWidth", "borderRightWidth", "paddingLeft", "paddingRight"],
            p = e.effects.setMode(o, t.mode || "effect"),
            d = t.restore || p !== "effect",
            v = t.scale || "both",
            m = t.origin || ["middle", "center"],
            g = o.css("position"),
            y = d ? u : a,
            b = {
                height: 0,
                width: 0,
                outerHeight: 0,
                outerWidth: 0
            };
        p === "show" && o.show(), r = {
            height: o.height(),
            width: o.width(),
            outerHeight: o.outerHeight(),
            outerWidth: o.outerWidth()
        }, t.mode === "toggle" && p === "show" ? (o.from = t.to || b, o.to = t.from || r) : (o.from = t.from || (p === "show" ? b : r), o.to = t.to || (p === "hide" ? b : r)), s = {
            from: {
                y: o.from.height / r.height,
                x: o.from.width / r.width
            },
            to: {
                y: o.to.height / r.height,
                x: o.to.width / r.width
            }
        };
        if (v === "box" || v === "both") s.from.y !== s.to.y && (y = y.concat(c), o.from = e.effects.setTransition(o, c, s.from.y, o.from), o.to = e.effects.setTransition(o, c, s.to.y, o.to)), s.from.x !== s.to.x && (y = y.concat(h), o.from = e.effects.setTransition(o, h, s.from.x, o.from), o.to = e.effects.setTransition(o, h, s.to.x, o.to));
        (v === "content" || v === "both") && s.from.y !== s.to.y && (y = y.concat(l).concat(f), o.from = e.effects.setTransition(o, l, s.from.y, o.from), o.to = e.effects.setTransition(o, l, s.to.y, o.to)), e.effects.save(o, y), o.show(), e.effects.createWrapper(o), o.css("overflow", "hidden").css(o.from), m && (i = e.effects.getBaseline(m, r), o.from.top = (r.outerHeight - o.outerHeight()) * i.y, o.from.left = (r.outerWidth - o.outerWidth()) * i.x, o.to.top = (r.outerHeight - o.to.outerHeight) * i.y, o.to.left = (r.outerWidth - o.to.outerWidth) * i.x), o.css(o.from);
        if (v === "content" || v === "both") c = c.concat(["marginTop", "marginBottom"]).concat(l), h = h.concat(["marginLeft", "marginRight"]), f = u.concat(c).concat(h), o.find("*[width]").each(function () {
            var n = e(this),
                r = {
                    height: n.height(),
                    width: n.width(),
                    outerHeight: n.outerHeight(),
                    outerWidth: n.outerWidth()
                };
            d && e.effects.save(n, f), n.from = {
                height: r.height * s.from.y,
                width: r.width * s.from.x,
                outerHeight: r.outerHeight * s.from.y,
                outerWidth: r.outerWidth * s.from.x
            }, n.to = {
                height: r.height * s.to.y,
                width: r.width * s.to.x,
                outerHeight: r.height * s.to.y,
                outerWidth: r.width * s.to.x
            }, s.from.y !== s.to.y && (n.from = e.effects.setTransition(n, c, s.from.y, n.from), n.to = e.effects.setTransition(n, c, s.to.y, n.to)), s.from.x !== s.to.x && (n.from = e.effects.setTransition(n, h, s.from.x, n.from), n.to = e.effects.setTransition(n, h, s.to.x, n.to)), n.css(n.from), n.animate(n.to, t.duration, t.easing, function () {
                d && e.effects.restore(n, f)
            })
        });
        o.animate(o.to, {
            queue: !1,
            duration: t.duration,
            easing: t.easing,
            complete: function () {
                o.to.opacity === 0 && o.css("opacity", o.from.opacity), p === "hide" && o.hide(), e.effects.restore(o, y), d || (g === "static" ? o.css({
                    position: "relative",
                    top: o.to.top,
                    left: o.to.left
                }) : e.each(["top", "left"], function (e, t) {
                    o.css(t, function (t, n) {
                        var r = parseInt(n, 10),
                            i = e ? o.to.left : o.to.top;
                        return n === "auto" ? i + "px" : r + i + "px"
                    })
                })), e.effects.removeWrapper(o), n()
            }
        })
    }
}(jQuery),
function (e, t) {
    e.effects.effect.shake = function (t, n) {
        var r = e(this),
            i = ["position", "top", "bottom", "left", "right", "height", "width"],
            s = e.effects.setMode(r, t.mode || "effect"),
            o = t.direction || "left",
            u = t.distance || 20,
            a = t.times || 3,
            f = a * 2 + 1,
            l = Math.round(t.duration / f),
            c = o === "up" || o === "down" ? "top" : "left",
            h = o === "up" || o === "left",
            p = {}, d = {}, v = {}, m, g = r.queue(),
            y = g.length;
        e.effects.save(r, i), r.show(), e.effects.createWrapper(r), p[c] = (h ? "-=" : "+=") + u, d[c] = (h ? "+=" : "-=") + u * 2, v[c] = (h ? "-=" : "+=") + u * 2, r.animate(p, l, t.easing);
        for (m = 1; m < a; m++) r.animate(d, l, t.easing).animate(v, l, t.easing);
        r.animate(d, l, t.easing).animate(p, l / 2, t.easing).queue(function () {
            s === "hide" && r.hide(), e.effects.restore(r, i), e.effects.removeWrapper(r), n()
        }), y > 1 && g.splice.apply(g, [1, 0].concat(g.splice(y, f + 1))), r.dequeue()
    }
}(jQuery),
function (e, t) {
    e.effects.effect.slide = function (t, n) {
        var r = e(this),
            i = ["position", "top", "bottom", "left", "right", "width", "height"],
            s = e.effects.setMode(r, t.mode || "show"),
            o = s === "show",
            u = t.direction || "left",
            a = u === "up" || u === "down" ? "top" : "left",
            f = u === "up" || u === "left",
            l, c = {};
        e.effects.save(r, i), r.show(), l = t.distance || r[a === "top" ? "outerHeight" : "outerWidth"](!0), e.effects.createWrapper(r).css({
            overflow: "hidden"
        }), o && r.css(a, f ? isNaN(l) ? "-" + l : -l : l), c[a] = (o ? f ? "+=" : "-=" : f ? "-=" : "+=") + l, r.animate(c, {
            queue: !1,
            duration: t.duration,
            easing: t.easing,
            complete: function () {
                s === "hide" && r.hide(), e.effects.restore(r, i), e.effects.removeWrapper(r), n()
            }
        })
    }
}(jQuery),
function (e, t) {
    e.effects.effect.transfer = function (t, n) {
        var r = e(this),
            i = e(t.to),
            s = i.css("position") === "fixed",
            o = e("body"),
            u = s ? o.scrollTop() : 0,
            a = s ? o.scrollLeft() : 0,
            f = i.offset(),
            l = {
                top: f.top - u,
                left: f.left - a,
                height: i.innerHeight(),
                width: i.innerWidth()
            }, c = r.offset(),
            h = e("<div class='ui-effects-transfer'></div>").appendTo(document.body).addClass(t.className).css({
                top: c.top - u,
                left: c.left - a,
                height: r.innerHeight(),
                width: r.innerWidth(),
                position: s ? "fixed" : "absolute"
            }).animate(l, t.duration, t.easing, function () {
                h.remove(), n()
            })
    }
}(jQuery), ! function (e) {
    "use strict";
    e(function () {
        e.support.transition = function () {
            var e = function () {
                var e = document.createElement("bootstrap"),
                    t = {
                        WebkitTransition: "webkitTransitionEnd",
                        MozTransition: "transitionend",
                        OTransition: "oTransitionEnd otransitionend",
                        transition: "transitionend"
                    }, n;
                for (n in t)
                    if (e.style[n] !== undefined) return t[n]
            }();
            return e && {
                end: e
            }
        }()
    })
}(window.jQuery), ! function (e) {
    "use strict";
    var t = function (t, n) {
        this.options = e.extend({}, e.fn.affix.defaults, n), this.$window = e(window).on("scroll.affix.data-api", e.proxy(this.checkPosition, this)).on("click.affix.data-api", e.proxy(function () {
            setTimeout(e.proxy(this.checkPosition, this), 1)
        }, this)), this.$element = e(t), this.checkPosition()
    };
    t.prototype.checkPosition = function () {
        if (!this.$element.is(":visible")) return;
        var t = e(document).height(),
            n = this.$window.scrollTop(),
            r = this.$element.offset(),
            i = this.options.offset,
            s = i.bottom,
            o = i.top,
            u = "affix affix-top affix-bottom",
            a;
        typeof i != "object" && (s = o = i), typeof o == "function" && (o = i.top()), typeof s == "function" && (s = i.bottom()), a = this.unpin != null && n + this.unpin <= r.top ? !1 : s != null && r.top + this.$element.height() >= t - s ? "bottom" : o != null && n <= o ? "top" : !1;
        if (this.affixed === a) return;
        this.affixed = a, this.unpin = a == "bottom" ? r.top - n : null, this.$element.removeClass(u).addClass("affix" + (a ? "-" + a : ""))
    };
    var n = e.fn.affix;
    e.fn.affix = function (n) {
        return this.each(function () {
            var r = e(this),
                i = r.data("affix"),
                s = typeof n == "object" && n;
            i || r.data("affix", i = new t(this, s)), typeof n == "string" && i[n]()
        })
    }, e.fn.affix.Constructor = t, e.fn.affix.defaults = {
        offset: 0
    }, e.fn.affix.noConflict = function () {
        return e.fn.affix = n, this
    }, e(window).on("load", function () {
        e('[data-spy="affix"]').each(function () {
            var t = e(this),
                n = t.data();
            n.offset = n.offset || {}, n.offsetBottom && (n.offset.bottom = n.offsetBottom), n.offsetTop && (n.offset.top = n.offsetTop), t.affix(n)
        })
    })
}(window.jQuery), ! function (e) {
    "use strict";
    var t = '[data-dismiss="alert"]',
        n = function (n) {
            e(n).on("click", t, this.close)
        };
    n.prototype.close = function (t) {
        function s() {
            i.trigger("closed").remove()
        }
        var n = e(this),
            r = n.attr("data-target"),
            i;
        r || (r = n.attr("href"), r = r && r.replace(/.*(?=#[^\s]*$)/, "")), i = e(r), t && t.preventDefault(), i.length || (i = n.hasClass("alert") ? n : n.parent()), i.trigger(t = e.Event("close"));
        if (t.isDefaultPrevented()) return;
        i.removeClass("in"), e.support.transition && i.hasClass("fade") ? i.on(e.support.transition.end, s) : s()
    };
    var r = e.fn.alert;
    e.fn.alert = function (t) {
        return this.each(function () {
            var r = e(this),
                i = r.data("alert");
            i || r.data("alert", i = new n(this)), typeof t == "string" && i[t].call(r)
        })
    }, e.fn.alert.Constructor = n, e.fn.alert.noConflict = function () {
        return e.fn.alert = r, this
    }, e(document).on("click.alert.data-api", t, n.prototype.close)
}(window.jQuery), ! function (e) {
    "use strict";
    var t = function (t, n) {
        this.$element = e(t), this.options = e.extend({}, e.fn.button.defaults, n)
    };
    t.prototype.setState = function (e) {
        var t = "disabled",
            n = this.$element,
            r = n.data(),
            i = n.is("input") ? "val" : "html";
        e += "Text", r.resetText || n.data("resetText", n[i]()), n[i](r[e] || this.options[e]), setTimeout(function () {
            e == "loadingText" ? n.addClass(t).attr(t, t) : n.removeClass(t).removeAttr(t)
        }, 0)
    }, t.prototype.toggle = function () {
        var e = this.$element.closest('[data-toggle="buttons-radio"]');
        e && e.find(".active").removeClass("active"), this.$element.toggleClass("active")
    };
    var n = e.fn.button;
    e.fn.button = function (n) {
        return this.each(function () {
            var r = e(this),
                i = r.data("button"),
                s = typeof n == "object" && n;
            i || r.data("button", i = new t(this, s)), n == "toggle" ? i.toggle() : n && i.setState(n)
        })
    }, e.fn.button.defaults = {
        loadingText: "loading..."
    }, e.fn.button.Constructor = t, e.fn.button.noConflict = function () {
        return e.fn.button = n, this
    }, e(document).on("click.button.data-api", "[data-toggle^=button]", function (t) {
        var n = e(t.target);
        n.hasClass("btn") || (n = n.closest(".btn")), n.button("toggle")
    })
}(window.jQuery), ! function (e) {
    "use strict";
    var t = function (t, n) {
        this.$element = e(t), this.$indicators = this.$element.find(".carousel-indicators"), this.options = n, this.options.pause == "hover" && this.$element.on("mouseenter", e.proxy(this.pause, this)).on("mouseleave", e.proxy(this.cycle, this))
    };
    t.prototype = {
        cycle: function (t) {
            return t || (this.paused = !1), this.interval && clearInterval(this.interval), this.options.interval && !this.paused && (this.interval = setInterval(e.proxy(this.next, this), this.options.interval)), this
        },
        getActiveIndex: function () {
            return this.$active = this.$element.find(".item.active"), this.$items = this.$active.parent().children(), this.$items.index(this.$active)
        },
        to: function (t) {
            var n = this.getActiveIndex(),
                r = this;
            if (t > this.$items.length - 1 || t < 0) return;
            return this.sliding ? this.$element.one("slid", function () {
                r.to(t)
            }) : n == t ? this.pause().cycle() : this.slide(t > n ? "next" : "prev", e(this.$items[t]))
        },
        pause: function (t) {
            return t || (this.paused = !0), this.$element.find(".next, .prev").length && e.support.transition.end && (this.$element.trigger(e.support.transition.end), this.cycle()), clearInterval(this.interval), this.interval = null, this
        },
        next: function () {
            if (this.sliding) return;
            return this.slide("next")
        },
        prev: function () {
            if (this.sliding) return;
            return this.slide("prev")
        },
        slide: function (t, n) {
            var r = this.$element.find(".item.active"),
                i = n || r[t](),
                s = this.interval,
                o = t == "next" ? "left" : "right",
                u = t == "next" ? "first" : "last",
                a = this,
                f;
            this.sliding = !0, s && this.pause(), i = i.length ? i : this.$element.find(".item")[u](), f = e.Event("slide", {
                relatedTarget: i[0],
                direction: o
            });
            if (i.hasClass("active")) return;
            this.$indicators.length && (this.$indicators.find(".active").removeClass("active"), this.$element.one("slid", function () {
                var t = e(a.$indicators.children()[a.getActiveIndex()]);
                t && t.addClass("active")
            }));
            if (e.support.transition && this.$element.hasClass("slide")) {
                this.$element.trigger(f);
                if (f.isDefaultPrevented()) return;
                i.addClass(t), i[0].offsetWidth, r.addClass(o), i.addClass(o), this.$element.one(e.support.transition.end, function () {
                    i.removeClass([t, o].join(" ")).addClass("active"), r.removeClass(["active", o].join(" ")), a.sliding = !1, setTimeout(function () {
                        a.$element.trigger("slid")
                    }, 0)
                })
            } else {
                this.$element.trigger(f);
                if (f.isDefaultPrevented()) return;
                r.removeClass("active"), i.addClass("active"), this.sliding = !1, this.$element.trigger("slid")
            }
            return s && this.cycle(), this
        }
    };
    var n = e.fn.carousel;
    e.fn.carousel = function (n) {
        return this.each(function () {
            var r = e(this),
                i = r.data("carousel"),
                s = e.extend({}, e.fn.carousel.defaults, typeof n == "object" && n),
                o = typeof n == "string" ? n : s.slide;
            i || r.data("carousel", i = new t(this, s)), typeof n == "number" ? i.to(n) : o ? i[o]() : s.interval && i.pause().cycle()
        })
    }, e.fn.carousel.defaults = {
        interval: 5e3,
        pause: "hover"
    }, e.fn.carousel.Constructor = t, e.fn.carousel.noConflict = function () {
        return e.fn.carousel = n, this
    }, e(document).on("click.carousel.data-api", "[data-slide], [data-slide-to]", function (t) {
        var n = e(this),
            r, i = e(n.attr("data-target") || (r = n.attr("href")) && r.replace(/.*(?=#[^\s]+$)/, "")),
            s = e.extend({}, i.data(), n.data()),
            o;
        i.carousel(s), (o = n.attr("data-slide-to")) && i.data("carousel").pause().to(o).cycle(), t.preventDefault()
    })
}(window.jQuery), ! function (e) {
    "use strict";
    var t = function (t, n) {
        this.$element = e(t), this.options = e.extend({}, e.fn.collapse.defaults, n), this.options.parent && (this.$parent = e(this.options.parent)), this.options.toggle && this.toggle()
    };
    t.prototype = {
        constructor: t,
        dimension: function () {
            var e = this.$element.hasClass("width");
            return e ? "width" : "height"
        },
        show: function () {
            var t, n, r, i;
            if (this.transitioning || this.$element.hasClass("in")) return;
            t = this.dimension(), n = e.camelCase(["scroll", t].join("-")), r = this.$parent && this.$parent.find("> .accordion-group > .in");
            if (r && r.length) {
                i = r.data("collapse");
                if (i && i.transitioning) return;
                r.collapse("hide"), i || r.data("collapse", null)
            }
            this.$element[t](0), this.transition("addClass", e.Event("show"), "shown"), e.support.transition && this.$element[t](this.$element[0][n])
        },
        hide: function () {
            var t;
            if (this.transitioning || !this.$element.hasClass("in")) return;
            t = this.dimension(), this.reset(this.$element[t]()), this.transition("removeClass", e.Event("hide"), "hidden"), this.$element[t](0)
        },
        reset: function (e) {
            var t = this.dimension();
            return this.$element.removeClass("collapse")[t](e || "auto")[0].offsetWidth, this.$element[e !== null ? "addClass" : "removeClass"]("collapse"), this
        },
        transition: function (t, n, r) {
            var i = this,
                s = function () {
                    n.type == "show" && i.reset(), i.transitioning = 0, i.$element.trigger(r)
                };
            this.$element.trigger(n);
            if (n.isDefaultPrevented()) return;
            this.transitioning = 1, this.$element[t]("in"), e.support.transition && this.$element.hasClass("collapse") ? this.$element.one(e.support.transition.end, s) : s()
        },
        toggle: function () {
            this[this.$element.hasClass("in") ? "hide" : "show"]()
        }
    };
    var n = e.fn.collapse;
    e.fn.collapse = function (n) {
        return this
            .each(function () {
                var r = e(this),
                    i = r.data("collapse"),
                    s = e.extend({}, e.fn.collapse.defaults, r.data(), typeof n == "object" && n);
                i || r.data("collapse", i = new t(this, s)), typeof n == "string" && i[n]()
            })
    }, e.fn.collapse.defaults = {
        toggle: !0
    }, e.fn.collapse.Constructor = t, e.fn.collapse.noConflict = function () {
        return e.fn.collapse = n, this
    }, e(document).on("click.collapse.data-api", "[data-toggle=collapse]", function (t) {
        var n = e(this),
            r, i = n.attr("data-target") || t.preventDefault() || (r = n.attr("href")) && r.replace(/.*(?=#[^\s]+$)/, ""),
            s = e(i).data("collapse") ? "toggle" : n.data();
        n[e(i).hasClass("in") ? "addClass" : "removeClass"]("collapsed"), e(i).collapse(s)
    })
}(window.jQuery), ! function (e) {
    "use strict";

    function r() {
        e(t).each(function () {
            i(e(this)).removeClass("open")
        })
    }

    function i(t) {
        var n = t.attr("data-target"),
            r;
        n || (n = t.attr("href"), n = n && /#/.test(n) && n.replace(/.*(?=#[^\s]*$)/, "")), r = n && e(n);
        if (!r || !r.length) r = t.parent();
        return r
    }
    var t = "[data-toggle=dropdown]",
        n = function (t) {
            var n = e(t).on("click.dropdown.data-api", this.toggle);
            e("html").on("click.dropdown.data-api", function () {
                n.parent().removeClass("open")
            })
        };
    n.prototype = {
        constructor: n,
        toggle: function (t) {
            var n = e(this),
                s, o;
            if (n.is(".disabled, :disabled")) return;
            return s = i(n), o = s.hasClass("open"), r(), o || s.toggleClass("open"), n.focus(), !1
        },
        keydown: function (n) {
            var r, s, o, u, a, f;
            if (!/(38|40|27)/.test(n.keyCode)) return;
            r = e(this), n.preventDefault(), n.stopPropagation();
            if (r.is(".disabled, :disabled")) return;
            u = i(r), a = u.hasClass("open");
            if (!a || a && n.keyCode == 27) return n.which == 27 && u.find(t).focus(), r.click();
            s = e("[role=menu] li:not(.divider):visible a", u);
            if (!s.length) return;
            f = s.index(s.filter(":focus")), n.keyCode == 38 && f > 0 && f--, n.keyCode == 40 && f < s.length - 1 && f++, ~f || (f = 0), s.eq(f).focus()
        }
    };
    var s = e.fn.dropdown;
    e.fn.dropdown = function (t) {
        return this.each(function () {
            var r = e(this),
                i = r.data("dropdown");
            i || r.data("dropdown", i = new n(this)), typeof t == "string" && i[t].call(r)
        })
    }, e.fn.dropdown.Constructor = n, e.fn.dropdown.noConflict = function () {
        return e.fn.dropdown = s, this
    }, e(document).on("click.dropdown.data-api", r).on("click.dropdown.data-api", ".dropdown form", function (e) {
        e.stopPropagation()
    }).on(".dropdown-menu", function (e) {
        e.stopPropagation()
    }).on("click.dropdown.data-api", t, n.prototype.toggle).on("keydown.dropdown.data-api", t + ", [role=menu]", n.prototype.keydown)
}(window.jQuery), ! function (e) {
    "use strict";
    var t = function (t, n) {
        this.options = n, this.$element = e(t).delegate('[data-dismiss="modal"]', "click.dismiss.modal", e.proxy(this.hide, this)), this.options.remote && this.$element.find(".modal-body").load(this.options.remote)
    };
    t.prototype = {
        constructor: t,
        toggle: function () {
            return this[this.isShown ? "hide" : "show"]()
        },
        show: function () {
            var t = this,
                n = e.Event("show");
            this.$element.trigger(n);
            if (this.isShown || n.isDefaultPrevented()) return;
            this.isShown = !0, this.escape(), this.backdrop(function () {
                var n = e.support.transition && t.$element.hasClass("fade");
                t.$element.parent().length || t.$element.appendTo(document.body), t.$element.show(), n && t.$element[0].offsetWidth, t.$element.addClass("in").attr("aria-hidden", !1), t.enforceFocus(), n ? t.$element.one(e.support.transition.end, function () {
                    t.$element.focus().trigger("shown")
                }) : t.$element.focus().trigger("shown")
            })
        },
        hide: function (t) {
            t && t.preventDefault();
            var n = this;
            t = e.Event("hide"), this.$element.trigger(t);
            if (!this.isShown || t.isDefaultPrevented()) return;
            this.isShown = !1, this.escape(), e(document).off("focusin.modal"), this.$element.removeClass("in").attr("aria-hidden", !0), e.support.transition && this.$element.hasClass("fade") ? this.hideWithTransition() : this.hideModal()
        },
        enforceFocus: function () {
            var t = this;
            e(document).on("focusin.modal", function (e) {
                t.$element[0] !== e.target && !t.$element.has(e.target).length && t.$element.focus()
            })
        },
        escape: function () {
            var e = this;
            this.isShown && this.options.keyboard ? this.$element.on("keyup.dismiss.modal", function (t) {
                t.which == 27 && e.hide()
            }) : this.isShown || this.$element.off("keyup.dismiss.modal")
        },
        hideWithTransition: function () {
            var t = this,
                n = setTimeout(function () {
                    t.$element.off(e.support.transition.end), t.hideModal()
                }, 500);
            this.$element.one(e.support.transition.end, function () {
                clearTimeout(n), t.hideModal()
            })
        },
        hideModal: function () {
            var e = this;
            this.$element.hide(), this.backdrop(function () {
                e.removeBackdrop(), e.$element.trigger("hidden")
            })
        },
        removeBackdrop: function () {
            this.$backdrop.remove(), this.$backdrop = null
        },
        backdrop: function (t) {
            var n = this,
                r = this.$element.hasClass("fade") ? "fade" : "";
            if (this.isShown && this.options.backdrop) {
                var i = e.support.transition && r;
                this.$backdrop = e('<div class="modal-backdrop ' + r + '" />').appendTo(document.body), this.$backdrop.click(this.options.backdrop == "static" ? e.proxy(this.$element[0].focus, this.$element[0]) : e.proxy(this.hide, this)), i && this.$backdrop[0].offsetWidth, this.$backdrop.addClass("in");
                if (!t) return;
                i ? this.$backdrop.one(e.support.transition.end, t) : t()
            } else !this.isShown && this.$backdrop ? (this.$backdrop.removeClass("in"), e.support.transition && this.$element.hasClass("fade") ? this.$backdrop.one(e.support.transition.end, t) : t()) : t && t()
        }
    };
    var n = e.fn.modal;
    e.fn.modal = function (n) {
        return this.each(function () {
            var r = e(this),
                i = r.data("modal"),
                s = e.extend({}, e.fn.modal.defaults, r.data(), typeof n == "object" && n);
            i || r.data("modal", i = new t(this, s)), typeof n == "string" ? i[n]() : s.show && i.show()
        })
    }, e.fn.modal.defaults = {
        backdrop: !0,
        keyboard: !0,
        show: !0
    }, e.fn.modal.Constructor = t, e.fn.modal.noConflict = function () {
        return e.fn.modal = n, this
    }, e(document).on("click.modal.data-api", '[data-toggle="modal"]', function (t) {
        var n = e(this),
            r = n.attr("href"),
            i = e(n.attr("data-target") || r && r.replace(/.*(?=#[^\s]+$)/, "")),
            s = i.data("modal") ? "toggle" : e.extend({
                remote: !/#/.test(r) && r
            }, i.data(), n.data());
        t.preventDefault(), i.modal(s).one("hide", function () {
            n.focus()
        })
    })
}(window.jQuery), ! function (e) {
    "use strict";

    function t(t, n) {
        var r = e.proxy(this.process, this),
            i = e(t).is("body") ? e(window) : e(t),
            s;
        this.options = e.extend({}, e.fn.scrollspy.defaults, n), this.$scrollElement = i.on("scroll.scroll-spy.data-api", r), this.selector = (this.options.target || (s = e(t).attr("href")) && s.replace(/.*(?=#[^\s]+$)/, "") || "") + " .nav li > a", this.$body = e("body"), this.refresh(), this.process()
    }
    t.prototype = {
        constructor: t,
        refresh: function () {
            var t = this,
                n;
            this.offsets = e([]), this.targets = e([]), n = this.$body.find(this.selector).map(function () {
                var n = e(this),
                    r = n.data("target") || n.attr("href"),
                    i = /^#\w/.test(r) && e(r);
                return i && i.length && [
                    [i.position().top + (!e.isWindow(t.$scrollElement.get(0)) && t.$scrollElement.scrollTop()), r]
                ] || null
            }).sort(function (e, t) {
                return e[0] - t[0]
            }).each(function () {
                t.offsets.push(this[0]), t.targets.push(this[1])
            })
        },
        process: function () {
            var e = this.$scrollElement.scrollTop() + this.options.offset,
                t = this.$scrollElement[0].scrollHeight || this.$body[0].scrollHeight,
                n = t - this.$scrollElement.height(),
                r = this.offsets,
                i = this.targets,
                s = this.activeTarget,
                o;
            if (e >= n) return s != (o = i.last()[0]) && this.activate(o);
            for (o = r.length; o--;) s != i[o] && e >= r[o] && (!r[o + 1] || e <= r[o + 1]) && this.activate(i[o])
        },
        activate: function (t) {
            var n, r;
            this.activeTarget = t, e(this.selector).parent(".active").removeClass("active"), r = this.selector + '[data-target="' + t + '"],' + this.selector + '[href="' + t + '"]', n = e(r).parent("li").addClass("active"), n.parent(".dropdown-menu").length && (n = n.closest("li.dropdown").addClass("active")), n.trigger("activate")
        }
    };
    var n = e.fn.scrollspy;
    e.fn.scrollspy = function (n) {
        return this.each(function () {
            var r = e(this),
                i = r.data("scrollspy"),
                s = typeof n == "object" && n;
            i || r.data("scrollspy", i = new t(this, s)), typeof n == "string" && i[n]()
        })
    }, e.fn.scrollspy.Constructor = t, e.fn.scrollspy.defaults = {
        offset: 10
    }, e.fn.scrollspy.noConflict = function () {
        return e.fn.scrollspy = n, this
    }, e(window).on("load", function () {
        e('[data-spy="scroll"]').each(function () {
            var t = e(this);
            t.scrollspy(t.data())
        })
    })
}(window.jQuery), ! function (e) {
    "use strict";
    var t = function (t) {
        this.element = e(t)
    };
    t.prototype = {
        constructor: t,
        show: function () {
            var t = this.element,
                n = t.closest("ul:not(.dropdown-menu)"),
                r = t.attr("data-target"),
                i, s, o;
            r || (r = t.attr("href"), r = r && r.replace(/.*(?=#[^\s]*$)/, ""));
            if (t.parent("li").hasClass("active")) return;
            i = n.find(".active:last a")[0], o = e.Event("show", {
                relatedTarget: i
            }), t.trigger(o);
            if (o.isDefaultPrevented()) return;
            s = e(r), this.activate(t.parent("li"), n), this.activate(s, s.parent(), function () {
                t.trigger({
                    type: "shown",
                    relatedTarget: i
                })
            })
        },
        activate: function (t, n, r) {
            function o() {
                i.removeClass("active").find("> .dropdown-menu > .active").removeClass("active"), t.addClass("active"), s ? (t[0].offsetWidth, t.addClass("in")) : t.removeClass("fade"), t.parent(".dropdown-menu") && t.closest("li.dropdown").addClass("active"), r && r()
            }
            var i = n.find("> .active"),
                s = r && e.support.transition && i.hasClass("fade");
            s ? i.one(e.support.transition.end, o) : o(), i.removeClass("in")
        }
    };
    var n = e.fn.tab;
    e.fn.tab = function (n) {
        return this.each(function () {
            var r = e(this),
                i = r.data("tab");
            i || r.data("tab", i = new t(this)), typeof n == "string" && i[n]()
        })
    }, e.fn.tab.Constructor = t, e.fn.tab.noConflict = function () {
        return e.fn.tab = n, this
    }, e(document).on("click.tab.data-api", '[data-toggle="tab"], [data-toggle="pill"]', function (t) {
        t.preventDefault(), e(this).tab("show")
    })
}(window.jQuery), ! function (e) {
    "use strict";
    var t = function (e, t) {
        this.init("tooltip", e, t)
    };
    t.prototype = {
        constructor: t,
        init: function (t, n, r) {
            var i, s, o, u, a;
            this.type = t, this.$element = e(n), this.options = this.getOptions(r), this.enabled = !0, o = this.options.trigger.split(" ");
            for (a = o.length; a--;) u = o[a], u == "click" ? this.$element.on("click." + this.type, this.options.selector, e.proxy(this.toggle, this)) : u != "manual" && (i = u == "hover" ? "mouseenter" : "focus", s = u == "hover" ? "mouseleave" : "blur", this.$element.on(i + "." + this.type, this.options.selector, e.proxy(this.enter, this)), this.$element.on(s + "." + this.type, this.options.selector, e.proxy(this.leave, this)));
            this.options.selector ? this._options = e.extend({}, this.options, {
                trigger: "manual",
                selector: ""
            }) : this.fixTitle()
        },
        getOptions: function (t) {
            return t = e.extend({}, e.fn[this.type].defaults, this.$element.data(), t), t.delay && typeof t.delay == "number" && (t.delay = {
                show: t.delay,
                hide: t.delay
            }), t
        },
        enter: function (t) {
            var n = e(t.currentTarget)[this.type](this._options).data(this.type);
            if (!n.options.delay || !n.options.delay.show) return n.show();
            clearTimeout(this.timeout), n.hoverState = "in", this.timeout = setTimeout(function () {
                n.hoverState == "in" && n.show()
            }, n.options.delay.show)
        },
        leave: function (t) {
            var n = e(t.currentTarget)[this.type](this._options).data(this.type);
            this.timeout && clearTimeout(this.timeout);
            if (!n.options.delay || !n.options.delay.hide) return n.hide();
            n.hoverState = "out", this.timeout = setTimeout(function () {
                n.hoverState == "out" && n.hide()
            }, n.options.delay.hide)
        },
        show: function () {
            var t, n, r, i, s, o, u = e.Event("show");
            if (this.hasContent() && this.enabled) {
                this.$element.trigger(u);
                if (u.isDefaultPrevented()) return;
                t = this.tip(), this.setContent(), this.options.animation && t.addClass("fade"), s = typeof this.options.placement == "function" ? this.options.placement.call(this, t[0], this.$element[0]) : this.options.placement, t.detach().css({
                    top: 0,
                    left: 0,
                    display: "block"
                }), this.options.container ? t.appendTo(this.options.container) : t.insertAfter(this.$element), n = this.getPosition(), r = t[0].offsetWidth, i = t[0].offsetHeight;
                switch (s) {
                case "bottom":
                    o = {
                        top: n.top + n.height,
                        left: n.left + n.width / 2 - r / 2
                    };
                    break;
                case "top":
                    o = {
                        top: n.top - i,
                        left: n.left + n.width / 2 - r / 2
                    };
                    break;
                case "left":
                    o = {
                        top: n.top + n.height / 2 - i / 2,
                        left: n.left - r
                    };
                    break;
                case "right":
                    o = {
                        top: n.top + n.height / 2 - i / 2,
                        left: n.left + n.width
                    }
                }
                this.applyPlacement(o, s), this.$element.trigger("shown")
            }
        },
        applyPlacement: function (e, t) {
            var n = this.tip(),
                r = n[0].offsetWidth,
                i = n[0].offsetHeight,
                s, o, u, a;
            n.offset(e).addClass(t).addClass("in"), s = n[0].offsetWidth, o = n[0].offsetHeight, t == "top" && o != i && (e.top = e.top + i - o, a = !0), t == "bottom" || t == "top" ? (u = 0, e.left < 0 && (u = e.left * -2, e.left = 0, n.offset(e), s = n[0].offsetWidth, o = n[0].offsetHeight), this.replaceArrow(u - r + s, s, "left")) : this.replaceArrow(o - i, o, "top"), a && n.offset(e)
        },
        replaceArrow: function (e, t, n) {
            this.arrow().css(n, e ? 50 * (1 - e / t) + "%" : "")
        },
        setContent: function () {
            var e = this.tip(),
                t = this.getTitle();
            e.find(".tooltip-inner")[this.options.html ? "html" : "text"](t), e.removeClass("fade in top bottom left right")
        },
        hide: function () {
            function i() {
                var t = setTimeout(function () {
                    n.off(e.support.transition.end).detach()
                }, 500);
                n.one(e.support.transition.end, function () {
                    clearTimeout(t), n.detach()
                })
            }
            var t = this,
                n = this.tip(),
                r = e.Event("hide");
            this.$element.trigger(r);
            if (r.isDefaultPrevented()) return;
            return n.removeClass("in"), e.support.transition && this.$tip.hasClass("fade") ? i() : n.detach(), this.$element.trigger("hidden"), this
        },
        fixTitle: function () {
            var e = this.$element;
            (e.attr("title") || typeof e.attr("data-original-title") != "string") && e.attr("data-original-title", e.attr("title") || "").attr("title", "")
        },
        hasContent: function () {
            return this.getTitle()
        },
        getPosition: function () {
            var t = this.$element[0];
            return e.extend({}, typeof t.getBoundingClientRect == "function" ? t.getBoundingClientRect() : {
                width: t.offsetWidth,
                height: t.offsetHeight
            }, this.$element.offset())
        },
        getTitle: function () {
            var e, t = this.$element,
                n = this.options;
            return e = t.attr("data-original-title") || (typeof n.title == "function" ? n.title.call(t[0]) : n.title), e
        },
        tip: function () {
            return this.$tip = this.$tip || e(this.options.template)
        },
        arrow: function () {
            return this.$arrow = this.$arrow || this.tip().find(".tooltip-arrow")
        },
        validate: function () {
            this.$element[0].parentNode || (this.hide(), this.$element = null, this.options = null)
        },
        enable: function () {
            this.enabled = !0
        },
        disable: function () {
            this.enabled = !1
        },
        toggleEnabled: function () {
            this.enabled = !this.enabled
        },
        toggle: function (t) {
            var n = t ? e(t.currentTarget)[this.type](this._options).data(this.type) : this;
            n.tip().hasClass("in") ? n.hide() : n.show()
        },
        destroy: function () {
            this.hide().$element.off("." + this.type).removeData(this.type)
        }
    };
    var n = e.fn.tooltip;
    e.fn.tooltip = function (n) {
        return this.each(function () {
            var r = e(this),
                i = r.data("tooltip"),
                s = typeof n == "object" && n;
            i || r.data("tooltip", i = new t(this, s)), typeof n == "string" && i[n]()
        })
    }, e.fn.tooltip.Constructor = t, e.fn.tooltip.defaults = {
        animation: !0,
        placement: "top",
        selector: !1,
        template: '<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',
        trigger: "hover focus",
        title: "",
        delay: 0,
        html: !1,
        container: !1
    }, e.fn.tooltip.noConflict = function () {
        return e.fn.tooltip = n, this
    }
}(window.jQuery), ! function (e) {
    "use strict";
    var t = function (e, t) {
        this.init("popover", e, t)
    };
    t.prototype = e.extend({}, e.fn.tooltip.Constructor.prototype, {
        constructor: t,
        setContent: function () {
            var e = this.tip(),
                t = this.getTitle(),
                n = this.getContent();
            e.find(".popover-title")[this.options.html ? "html" : "text"](t), e.find(".popover-content")[this.options.html ? "html" : "text"](n), e.removeClass("fade top bottom left right in")
        },
        hasContent: function () {
            return this.getTitle() || this.getContent()
        },
        getContent: function () {
            var e, t = this.$element,
                n = this.options;
            return e = (typeof n.content == "function" ? n.content.call(t[0]) : n.content) || t.attr("data-content"), e
        },
        tip: function () {
            return this.$tip || (this.$tip = e(this.options.template)), this.$tip
        },
        destroy: function () {
            this.hide().$element.off("." + this.type).removeData(this.type)
        }
    });
    var n = e.fn.popover;
    e.fn.popover = function (n) {
        return this.each(function () {
            var r = e(this),
                i = r.data("popover"),
                s = typeof n == "object" && n;
            i || r.data("popover", i = new t(this, s)), typeof n == "string" && i[n]()
        })
    }, e.fn.popover.Constructor = t, e.fn.popover.defaults = e.extend({}, e.fn.tooltip.defaults, {
        placement: "right",
        trigger: "click",
        content: "",
        template: '<div class="popover"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'
    }), e.fn.popover.noConflict = function () {
        return e.fn.popover = n, this
    }
}(window.jQuery), ! function (e) {
    "use strict";
    var t = function (t, n) {
        this.$element = e(t), this.options = e.extend({}, e.fn.typeahead.defaults, n), this.matcher = this.options.matcher || this.matcher, this.sorter = this.options.sorter || this.sorter, this.highlighter = this.options.highlighter || this.highlighter, this.updater = this.options.updater || this.updater, this.source = this.options.source, this.$menu = e(this.options.menu), this.shown = !1, this.listen()
    };
    t.prototype = {
        constructor: t,
        select: function () {
            var e = this.$menu.find(".active").attr("data-value");
            return this.$element.val(this.updater(e)).change(), this.hide()
        },
        updater: function (e) {
            return e
        },
        show: function () {
            var t = e.extend({}, this.$element.position(), {
                height: this.$element[0].offsetHeight
            });
            return this.$menu.insertAfter(this.$element).css({
                top: t.top + t.height,
                left: t.left
            }).show(), this.shown = !0, this
        },
        hide: function () {
            return this.$menu.hide(), this.shown = !1, this
        },
        lookup: function (t) {
            var n;
            return this.query = this.$element.val(), !this.query || this.query.length < this.options.minLength ? this.shown ? this.hide() : this : (n = e.isFunction(this.source) ? this.source(this.query, e.proxy(this.process, this)) : this.source, n ? this.process(n) : this)
        },
        process: function (t) {
            var n = this;
            return t = e.grep(t, function (e) {
                return n.matcher(e)
            }), t = this.sorter(t), t.length ? this.render(t.slice(0, this.options.items)).show() : this.shown ? this.hide() : this
        },
        matcher: function (e) {
            return~ e.toLowerCase().indexOf(this.query.toLowerCase())
        },
        sorter: function (e) {
            var t = [],
                n = [],
                r = [],
                i;
            while (i = e.shift()) i.toLowerCase().indexOf(this.query.toLowerCase()) ? ~i.indexOf(this.query) ? n.push(i) : r.push(i) : t.push(i);
            return t.concat(n, r)
        },
        highlighter: function (e) {
            var t = this.query.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&");
            return e.replace(new RegExp("(" + t + ")", "ig"), function (e, t) {
                return "<strong>" + t + "</strong>"
            })
        },
        render: function (t) {
            var n = this;
            return t = e(t).map(function (t, r) {
                return t = e(n.options.item).attr("data-value", r), t.find("a").html(n.highlighter(r)), t[0]
            }), t.first().addClass("active"), this.$menu.html(t), this
        },
        next: function (t) {
            var n = this.$menu.find(".active").removeClass("active"),
                r = n.next();
            r.length || (r = e(this.$menu.find("li")[0])), r.addClass("active")
        },
        prev: function (e) {
            var t = this.$menu.find(".active").removeClass("active"),
                n = t.prev();
            n.length || (n = this.$menu.find("li").last()), n.addClass("active")
        },
        listen: function () {
            this.$element.on("focus", e.proxy(this.focus, this)).on("blur", e.proxy(this.blur, this)).on("keypress", e.proxy(this.keypress, this)).on("keyup", e.proxy(this.keyup, this)), this.eventSupported("keydown") && this.$element.on("keydown", e.proxy(this.keydown, this)), this.$menu.on("click", e.proxy(this.click, this)).on("mouseenter", "li", e.proxy(this.mouseenter, this)).on("mouseleave", "li", e.proxy(this.mouseleave, this))
        },
        eventSupported: function (e) {
            var t = e in this.$element;
            return t || (this.$element.setAttribute(e, "return;"), t = typeof this.$element[e] == "function"), t
        },
        move: function (e) {
            if (!this.shown) return;
            switch (e.keyCode) {
            case 9:
            case 13:
            case 27:
                e.preventDefault();
                break;
            case 38:
                e.preventDefault(), this.prev();
                break;
            case 40:
                e.preventDefault(), this.next()
            }
            e.stopPropagation()
        },
        keydown: function (t) {
            this.suppressKeyPressRepeat = ~e.inArray(t.keyCode, [40, 38, 9, 13, 27]), this.move(t)
        },
        keypress: function (e) {
            if (this.suppressKeyPressRepeat) return;
            this.move(e)
        },
        keyup: function (e) {
            switch (e.keyCode) {
            case 40:
            case 38:
            case 16:
            case 17:
            case 18:
                break;
            case 9:
            case 13:
                if (!this.shown) return;
                this.select();
                break;
            case 27:
                if (!this.shown) return;
                this.hide();
                break;
            default:
                this.lookup()
            }
            e.stopPropagation(), e.preventDefault()
        },
        focus: function (e) {
            this.focused = !0
        },
        blur: function (e) {
            this.focused = !1, !this.mousedover && this.shown && this.hide()
        },
        click: function (e) {
            e.stopPropagation(), e.preventDefault(), this.select(), this.$element.focus()
        },
        mouseenter: function (t) {
            this.mousedover = !0, this.$menu.find(".active").removeClass("active"), e(t.currentTarget).addClass("active")
        },
        mouseleave: function (e) {
            this.mousedover = !1, !this.focused && this.shown && this.hide()
        }
    };
    var n = e.fn.typeahead;
    e.fn.typeahead = function (n) {
        return this.each(function () {
            var r = e(this),
                i = r.data("typeahead"),
                s = typeof n == "object" && n;
            i || r.data("typeahead", i = new t(this, s)), typeof n == "string" && i[n]()
        })
    }, e.fn.typeahead.defaults = {
        source: [],
        items: 8,
        menu: '<ul class="typeahead dropdown-menu"></ul>',
        item: '<li><a href="#"></a></li>',
        minLength: 1
    }, e.fn.typeahead.Constructor = t, e.fn.typeahead.noConflict = function () {
        return e.fn.typeahead = n, this
    }, e(document).on("focus.typeahead.data-api", '[data-provide="typeahead"]', function (t) {
        var n = e(this);
        if (n.data("typeahead")) return;
        n.typeahead(n.data())
    })
}(window.jQuery),
function (e, t) {
    function n(t) {
        e.extend(!0, gt, t)
    }

    function r(n, r, f) {
        function l(e) {
            tt ? (T(), x(), _(), b(e)) : c()
        }

        function c() {
            nt = r.theme ? "ui" : "fc", n.addClass("fc"), r.isRTL && n.addClass("fc-rtl"), r.theme && n.addClass("ui-widget"), tt = e("<div class='fc-content' style='position:relative'/>").prependTo(n), Z = new i(K, r), (et = Z.render()) && n.prepend(et), y(r.defaultView), e(window).resize(C), g() || p()
        }

        function p() {
            setTimeout(function () {
                !rt.start && g() && b()
            }, 0)
        }

        function d() {
            e(window).unbind("resize", C), Z.destroy(), tt.remove(), n.removeClass("fc fc-rtl ui-widget")
        }

        function v() {
            return Y.offsetWidth !== 0
        }

        function g() {
            return e("body")[0].offsetWidth !== 0
        }

        function y(t) {
            if (!rt || t != rt.name) {
                ft++, P();
                var n = rt,
                    r;
                n ? ((n.beforeHide || q)(), I(tt, tt.height()), n.element.hide()) : I(tt, 1), tt.css("overflow", "hidden"), (rt = it[t]) ? rt.element.show() : rt = it[t] = new wt[t](r = ut = e("<div class='fc-view fc-view-" + t + "' style='position:absolute'/>").appendTo(tt), K), n && Z.deactivateButton(n.name), Z.activateButton(t), b(), tt.css("overflow", ""), n && I(tt, 1), r || (rt.afterShow || q)(), ft--
            }
        }

        function b(e) {
            if (v()) {
                ft++, P(), ot === t && T();
                var r = !1;
                !rt.start || e || lt < rt.start || lt >= rt.end ? (rt.render(lt, e || 0), N(!0), r = !0) : rt.sizeDirty ? (rt.clearEvents(), N(), r = !0) : rt.eventsDirty && (rt.clearEvents(), r = !0), rt.sizeDirty = !1, rt.eventsDirty = !1, k(r), st = n.outerWidth(), Z.updateTitle(rt.title), e = new Date, e >= rt.start && e < rt.end ? Z.disableButton("today") : Z.enableButton("today"), ft--, rt.trigger("viewDisplay", Y)
            }
        }

        function S() {
            x(), v() && (T(), N(), P(), rt.clearEvents(), rt.renderEvents(ct), rt.sizeDirty = !1)
        }

        function x() {
            e.each(it, function (e, t) {
                t.sizeDirty = !0
            })
        }

        function T() {
            ot = r.contentHeight ? r.contentHeight : r.height ? r.height - (et ? et.height() : 0) - H(tt) : Math.round(tt.width() / Math.max(r.aspectRatio, .5))
        }

        function N(e) {
            ft++, rt.setHeight(ot, e), ut && (ut.css("position", "relative"), ut = null), rt.setWidth(tt.width(), e), ft--
        }

        function C() {
            if (!ft)
                if (rt.start) {
                    var e = ++at;
                    setTimeout(function () {
                        e == at && !ft && v() && st != (st = n.outerWidth()) && (ft++, S(), rt.trigger("windowResize", Y), ft--)
                    }, 200)
                } else p()
        }

        function k(e) {
            !r.lazyFetching || Q(rt.visStart, rt.visEnd) ? L() : e && M()
        }

        function L() {
            G(rt.visStart, rt.visEnd)
        }

        function A(e) {
            ct = e, M()
        }

        function O(e) {
            M(e)
        }

        function M(e) {
            _(), v() && (rt.clearEvents(), rt.renderEvents(ct, e), rt.eventsDirty = !1)
        }

        function _() {
            e.each(it, function (e, t) {
                t.eventsDirty = !0
            })
        }

        function D(e, n, r) {
            rt.select(e, n, r === t ? !0 : r)
        }

        function P() {
            rt && rt.unselect()
        }

        function B() {
            b(-1)
        }

        function j() {
            b(1)
        }

        function F() {
            o(lt, -1), b()
        }

        function R() {
            o(lt, 1), b()
        }

        function U() {
            lt = new Date, b()
        }

        function z(e, t, n) {
            e instanceof Date ? lt = h(e) : m(lt, e, t, n), b()
        }

        function W(e, n, r) {
            e !== t && o(lt, e), n !== t && u(lt, n), r !== t && a(lt, r), b()
        }

        function X() {
            return h(lt)
        }

        function V() {
            return rt
        }

        function $(e, n) {
            if (n === t) return r[e];
            if (e == "height" || e == "contentHeight" || e == "aspectRatio") r[e] = n, S()
        }

        function J(e, t) {
            if (r[e]) return r[e].apply(t || Y, Array.prototype.slice.call(arguments, 2))
        }
        var K = this;
        K.options = r, K.render = l, K.destroy = d, K.refetchEvents = L, K.reportEvents = A, K.reportEventChange = O, K.rerenderEvents = M, K.changeView = y, K.select = D, K.unselect = P, K.prev = B, K.next = j, K.prevYear = F, K.nextYear = R, K.today = U, K.gotoDate = z, K.incrementDate = W, K.formatDate = function (e, t) {
            return w(e, t, r)
        }, K.formatDates = function (e, t, n) {
            return E(e, t, n, r)
        }, K.getDate = X, K.getView = V, K.option = $, K.trigger = J, s.call(K, r, f);
        var Q = K.isFetchNeeded,
            G = K.fetchEvents,
            Y = n[0],
            Z, et, tt, nt, rt, it = {}, st, ot, ut, at = 0,
            ft = 0,
            lt = new Date,
            ct = [],
            ht;
        m(lt, r.year, r.month, r.date), r.droppable && e(document).bind("dragstart", function (t, n) {
            var i = t.target,
                s = e(i);
            if (!s.parents(".fc").length) {
                var o = r.dropAccept;
                if (e.isFunction(o) ? o.call(i, s) : s.is(o)) ht = i, rt.dragStart(ht, t, n)
            }
        }).bind("dragstop", function (e, t) {
            ht && (rt.dragStop(ht, e, t), ht = null)
        })
    }

    function i(t, n) {
        function r() {
            p = n.theme ? "ui" : "fc";
            if (n.header) return h = e("<table class='fc-header' style='width:100%'/>").append(e("<tr/>").append(s("left")).append(s("center")).append(s("right")))
        }

        function i() {
            h.remove()
        }

        function s(r) {
            var i = e("<td class='fc-header-" + r + "'/>");
            return (r = n.header[r]) && e.each(r.split(" "), function (r) {
                r > 0 && i.append("<span class='fc-header-space'/>");
                var s;
                e.each(this.split(","), function (r, o) {
                    if (o == "title") i.append("<span class='fc-header-title'><h2>&nbsp;</h2></span>"), s && s.addClass(p + "-corner-right"), s = null;
                    else {
                        var u;
                        t[o] ? u = t[o] : wt[o] && (u = function () {
                            f.removeClass(p + "-state-hover"), t.changeView(o)
                        });
                        if (u) {
                            r = n.theme ? W(n.buttonIcons, o) : null;
                            var a = W(n.buttonText, o),
                                f = e("<span class='fc-button fc-button-" + o + " " + p + "-state-default'><span class='fc-button-inner'><span class='fc-button-content'>" + (r ? "<span class='fc-icon-wrap'><span class='ui-icon ui-icon-" + r + "'/></span>" : a) + "</span><span class='fc-button-effect'><span></span></span></span></span>");
                            f && (f.click(function () {
                                f.hasClass(p + "-state-disabled") || u()
                            }).mousedown(function () {
                                f.not("." + p + "-state-active").not("." + p + "-state-disabled").addClass(p + "-state-down")
                            }).mouseup(function () {
                                f.removeClass(p + "-state-down")
                            }).hover(function () {
                                f.not("." + p + "-state-active").not("." + p + "-state-disabled").addClass(p + "-state-hover")
                            }, function () {
                                f.removeClass(p + "-state-hover").removeClass(p + "-state-down")
                            }).appendTo(i), s || f.addClass(p + "-corner-left"), s = f)
                        }
                    }
                }), s && s.addClass(p + "-corner-right")
            }), i
        }

        function o(e) {
            h.find("h2").html(e)
        }

        function u(e) {
            h.find("span.fc-button-" + e).addClass(p + "-state-active")
        }

        function a(e) {
            h.find("span.fc-button-" + e).removeClass(p + "-state-active")
        }

        function f(e) {
            h.find("span.fc-button-" + e).addClass(p + "-state-disabled")
        }

        function l(e) {
            h.find("span.fc-button-" + e).removeClass(p + "-state-disabled")
        }
        var c = this;
        c.render = r, c.destroy = i, c.updateTitle = o, c.activateButton = u, c.deactivateButton = a, c.disableButton = f, c.enableButton = l;
        var h = e([]),
            p
    }

    function s(n, r) {
        function i(e, t) {
            return !A || e < A || t > O
        }

        function s(e, t) {
            A = e, O = t, P = [], e = ++M, _ = t = L.length;
            for (var n = 0; n < t; n++) o(L[n], e)
        }

        function o(e, t) {
            u(e, function (n) {
                if (t == M) {
                    if (n) {
                        for (var r = 0; r < n.length; r++) n[r].source = e, b(n[r]);
                        P = P.concat(n)
                    }
                    _--, _ || C(P)
                }
            })
        }

        function u(t, r) {
            var i, s = bt.sourceFetchers,
                o;
            for (i = 0; i < s.length; i++) {
                o = s[i](t, A, O, r);
                if (o === !0) return;
                if (typeof o == "object") {
                    u(o, r);
                    return
                }
            }
            if (i = t.events) e.isFunction(i) ? (m(), i(h(A), h(O), function (e) {
                r(e), y()
            })) : e.isArray(i) ? r(i) : r();
            else if (t.url) {
                var a = t.success,
                    f = t.error,
                    l = t.complete;
                i = e.extend({}, t.data || {}), s = Y(t.startParam, n.startParam), o = Y(t.endParam, n.endParam), s && (i[s] = Math.round(+A / 1e3)), o && (i[o] = Math.round(+O / 1e3)), m(), e.ajax(e.extend({}, Et, t, {
                    data: i,
                    success: function (t) {
                        t = t || [];
                        var n = G(a, this, arguments);
                        e.isArray(n) && (t = n), r(t)
                    },
                    error: function () {
                        G(f, this, arguments), r()
                    },
                    complete: function () {
                        G(l, this, arguments), y()
                    }
                }))
            } else r()
        }

        function a(e) {
            if (e = f(e)) _++, o(e, M)
        }

        function f(t) {
            e.isFunction(t) || e.isArray(t) ? t = {
                events: t
            } : typeof t == "string" && (t = {
                url: t
            });
            if (typeof t == "object") return w(t), L.push(t), t
        }

        function l(t) {
            L = e.grep(L, function (e) {
                return !E(e, t)
            }), P = e.grep(P, function (e) {
                return !E(e.source, t)
            }), C(P)
        }

        function c(e) {
            var t, n = P.length,
                r, i = N().defaultEventEnd,
                s = e.start - e._start,
                o = e.end ? e.end - (e._end || i(e)) : 0;
            for (t = 0; t < n; t++) r = P[t], r._id == e._id && r != e && (r.start = new Date(+r.start + s), r.end = e.end ? r.end ? new Date(+r.end + o) : new Date(+i(r) + o) : null, r.title = e.title, r.url = e.url, r.allDay = e.allDay, r.className = e.className, r.editable = e.editable, r.color = e.color, r.backgroudColor = e.backgroudColor, r.borderColor = e.borderColor, r.textColor = e.textColor, b(r));
            b(e), C(P)
        }

        function p(e, t) {
            b(e), e.source || (t && (k.events.push(e), e.source = k), P.push(e)), C(P)
        }

        function d(t) {
            if (t) {
                if (!e.isFunction(t)) {
                    var n = t + "";
                    t = function (e) {
                        return e._id == n
                    }
                }
                P = e.grep(P, t, !0);
                for (r = 0; r < L.length; r++) e.isArray(L[r].events) && (L[r].events = e.grep(L[r].events, t, !0))
            } else {
                P = [];
                for (var r = 0; r < L.length; r++) e.isArray(L[r].events) && (L[r].events = [])
            }
            C(P)
        }

        function v(t) {
            return e.isFunction(t) ? e.grep(P, t) : t ? (t += "", e.grep(P, function (e) {
                return e._id == t
            })) : P
        }

        function m() {
            D++ || T("loading", null, !0)
        }

        function y() {
            --D || T("loading", null, !1)
        }

        function b(e) {
            var r = e.source || {}, i = Y(r.ignoreTimezone, n.ignoreTimezone);
            e._id = e._id || (e.id === t ? "_fc" + St++ : e.id + ""), e.date && (e.start || (e.start = e.date), delete e.date), e._start = h(e.start = g(e.start, i)), e.end = g(e.end, i), e.end && e.end <= e.start && (e.end = null), e._end = e.end ? h(e.end) : null, e.allDay === t && (e.allDay = Y(r.allDayDefault, n.allDayDefault)), e.className ? typeof e.className == "string" && (e.className = e.className.split(/\s+/)) : e.className = []
        }

        function w(e) {
            e.className ? typeof e.className == "string" && (e.className = e.className.split(/\s+/)) : e.className = [];
            for (var t = bt.sourceNormalizers, n = 0; n < t.length; n++) t[n](e)
        }

        function E(e, t) {
            return e && t && S(e) == S(t)
        }

        function S(e) {
            return (typeof e == "object" ? e.events || e.url : "") || e
        }
        var x = this;
        x.isFetchNeeded = i, x.fetchEvents = s, x.addEventSource = a, x.removeEventSource = l, x.updateEvent = c, x.renderEvent = p, x.removeEvents = d, x.clientEvents = v, x.normalizeEvent = b;
        var T = x.trigger,
            N = x.getView,
            C = x.reportEvents,
            k = {
                events: []
            }, L = [k],
            A, O, M = 0,
            _ = 0,
            D = 0,
            P = [];
        for (x = 0; x < r.length; x++) f(r[x])
    }

    function o(e, t, n) {
        return e.setFullYear(e.getFullYear() + t), n || c(e), e
    }

    function u(e, t, n) {
        if (+e) {
            t = e.getMonth() + t;
            var r = h(e);
            r.setDate(1), r.setMonth(t), e.setMonth(t);
            for (n || c(e); e.getMonth() != r.getMonth();) e.setDate(e.getDate() + (e < r ? 1 : -1))
        }
        return e
    }

    function a(e, t, n) {
        if (+e) {
            t = e.getDate() + t;
            var r = h(e);
            r.setHours(9), r.setDate(t), e.setDate(t), n || c(e), f(e, r)
        }
        return e
    }

    function f(e, t) {
        if (+e)
            for (; e.getDate() != t.getDate();) e.setTime(+e + (e < t ? 1 : -1) * Nt)
    }

    function l(e, t) {
        return e.setMinutes(e.getMinutes() + t), e
    }

    function c(e) {
        return e.setHours(0), e.setMinutes(0), e.setSeconds(0), e.setMilliseconds(0), e
    }

    function h(e, t) {
        return t ? c(new Date(+e)) : new Date(+e)
    }

    function p() {
        var e = 0,
            t;
        do t = new Date(1970, e++, 1); while (t.getHours());
        return t
    }

    function d(e, t, n) {
        for (t = t || 1; !e.getDay() || n && e.getDay() == 1 || !n && e.getDay() == 6;) a(e, t);
        return e
    }

    function v(e, t) {
        return Math.round((h(e, !0) - h(t, !0)) / Tt)
    }

    function m(e, n, r, i) {
        n !== t && n != e.getFullYear() && (e.setDate(1), e.setMonth(0), e.setFullYear(n)), r !== t && r != e.getMonth() && (e.setDate(1), e.setMonth(r)), i !== t && e.setDate(i)
    }

    function g(e, n) {
        return typeof e == "object" ? e : typeof e == "number" ? new Date(e * 1e3) : typeof e == "string" ? e.match(/^\d+(\.\d+)?$/) ? new Date(parseFloat(e) * 1e3) : (n === t && (n = !0), y(e, n) || (e ? new Date(e) : null)) : null
    }

    function y(e, t) {
        e = e.match(/^([0-9]{4})(-([0-9]{2})(-([0-9]{2})([T ]([0-9]{2}):([0-9]{2})(:([0-9]{2})(\.([0-9]+))?)?(Z|(([-+])([0-9]{2})(:?([0-9]{2}))?))?)?)?)?$/);
        if (!e) return null;
        var n = new Date(e[1], 0, 1);
        return t || !e[13] ? (t = new Date(e[1], 0, 1, 9, 0), e[3] && (n.setMonth(e[3] - 1), t.setMonth(e[3] - 1)), e[5] && (n.setDate(e[5]), t.setDate(e[5])), f(n, t), e[7] && n.setHours(e[7]), e[8] && n.setMinutes(e[8]), e[10] && n.setSeconds(e[10]), e[12] && n.setMilliseconds(Number("0." + e[12]) * 1e3), f(n, t)) : (n.setUTCFullYear(e[1], e[3] ? e[3] - 1 : 0, e[5] || 1), n.setUTCHours(e[7] || 0, e[8] || 0, e[10] || 0, e[12] ? Number("0." + e[12]) * 1e3 : 0), e[14] && (t = Number(e[16]) * 60 + (e[18] ? Number(e[18]) : 0), t *= e[15] == "-" ? 1 : -1, n = new Date(+n + t * 60 * 1e3))), n
    }

    function b(e) {
        if (typeof e == "number") return e * 60;
        if (typeof e == "object") return e.getHours() * 60 + e.getMinutes();
        if (e = e.match(/(\d+)(?::(\d+))?\s*(\w+)?/)) {
            var t = parseInt(e[1], 10);
            return e[3] && (t %= 12, e[3].toLowerCase().charAt(0) == "p" && (t += 12)), t * 60 + (e[2] ? parseInt(e[2], 10) : 0)
        }
    }

    function w(e, t, n) {
        return E(e, null, t, n)
    }

    function E(e, t, n, r) {
        r = r || gt;
        var i = e,
            s = t,
            o, u = n.length,
            a, f, l, c = "";
        for (o = 0; o < u; o++) {
            a = n.charAt(o);
            if (a == "'") {
                for (f = o + 1; f < u; f++)
                    if (n.charAt(f) == "'") {
                        i && (c += f == o + 1 ? "'" : n.substring(o + 1, f), o = f);
                        break
                    }
            } else if (a == "(") {
                for (f = o + 1; f < u; f++)
                    if (n.charAt(f) == ")") {
                        o = w(i, n.substring(o + 1, f), r), parseInt(o.replace(/\D/, ""), 10) && (c += o), o = f;
                        break
                    }
            } else if (a == "[") {
                for (f = o + 1; f < u; f++)
                    if (n.charAt(f) == "]") {
                        a = n.substring(o + 1, f), o = w(i, a, r), o != w(s, a, r) && (c += o), o = f;
                        break
                    }
            } else if (a == "{") i = t, s = e;
            else if (a == "}") i = e, s = t;
            else {
                for (f = u; f > o; f--)
                    if (l = kt[n.substring(o, f)]) {
                        i && (c += l(i, r)), o = f - 1;
                        break
                    }
                f == o && i && (c += a)
            }
        }
        return c
    }

    function S(e) {
        return e.end ? x(e.end, e.allDay) : a(h(e.start), 1)
    }

    function x(e, t) {
        return e = h(e), t || e.getHours() || e.getMinutes() ? a(e, 1) : c(e)
    }

    function T(e, t) {
        return (t.msLength - e.msLength) * 100 + (e.event.start - t.event.start)
    }

    function N(e, t) {
        return e.end > t.start && e.start < t.end
    }

    function C(e, t, n, r) {
        var i = [],
            s, o = e.length,
            u, a, f, l, c;
        for (s = 0; s < o; s++) u = e[s], a = u.start, f = t[s], f > n && a < r && (a < n ? (a = h(n), l = !1) : (a = a, l = !0), f > r ? (f = h(r), c = !1) : (f = f, c = !0), i.push({
            event: u,
            start: a,
            end: f,
            isStart: l,
            isEnd: c,
            msLength: f - a
        }));
        return i.sort(T)
    }

    function k(e) {
        var t = [],
            n, r = e.length,
            i, s, o, u;
        for (n = 0; n < r; n++) {
            i = e[n];
            for (s = 0;;) {
                o = !1;
                if (t[s])
                    for (u = 0; u < t[s].length; u++)
                        if (N(t[s][u], i)) {
                            o = !0;
                            break
                        }
                if (!o) break;
                s++
            }
            t[s] ? t[s].push(i) : t[s] = [i]
        }
        return t
    }

    function L(n, r, i) {
        n.unbind("mouseover").mouseover(function (n) {
            for (var s = n.target, o; s != this;) o = s, s = s.parentNode;
            (s = o._fci) !== t && (o._fci = t, o = r[s], i(o.event, o.element, o), e(n.target).trigger(n)), n.stopPropagation()
        })
    }

    function A(t, n, r) {
        for (var i = 0, s; i < t.length; i++) s = e(t[i]), s.width(Math.max(0, n - M(s, r)))
    }

    function O(t, n, r) {
        for (var i = 0, s; i < t.length; i++) s = e(t[i]), s.height(Math.max(0, n - H(s, r)))
    }

    function M(e, t) {
        return _(e) + P(e) + (t ? D(e) : 0)
    }

    function _(t) {
        return (parseFloat(e.css(t[0], "paddingLeft", !0)) || 0) + (parseFloat(e.css(t[0], "paddingRight", !0)) || 0)
    }

    function D(t) {
        return (parseFloat(e.css(t[0], "marginLeft", !0)) || 0) + (parseFloat(e.css(t[0], "marginRight", !0)) || 0)
    }

    function P(t) {
        return (parseFloat(e.css(t[0], "borderLeftWidth", !0)) || 0) + (parseFloat(e.css(t[0], "borderRightWidth", !0)) || 0)
    }

    function H(e, t) {
        return B(e) + F(e) + (t ? j(e) : 0)
    }

    function B(t) {
        return (parseFloat(e.css(t[0], "paddingTop", !0)) || 0) + (parseFloat(e.css(t[0], "paddingBottom", !0)) || 0)
    }

    function j(t) {
        return (parseFloat(e.css(t[0], "marginTop", !0)) || 0) + (parseFloat(e.css(t[0], "marginBottom", !0)) || 0)
    }

    function F(t) {
        return (parseFloat(e.css(t[0], "borderTopWidth", !0)) || 0) + (parseFloat(e.css(t[0], "borderBottomWidth", !0)) || 0)
    }

    function I(e, t) {
        t = typeof t == "number" ? t + "px" : t, e.each(function (e, n) {
            n.style.cssText += ";min-height:" + t + ";_height:" + t
        })
    }

    function q() {}

    function R(e, t) {
        return e - t
    }

    function U(e) {
        return Math.max.apply(Math, e)
    }

    function z(e) {
        return (e < 10 ? "0" : "") + e
    }

    function W(e, n) {
        if (e[n] !== t) return e[n];
        n = n.split(/(?=[A-Z])/);
        for (var r = n.length - 1, i; r >= 0; r--) {
            i = e[n[r].toLowerCase()];
            if (i !== t) return i
        }
        return e[""]
    }

    function X(e) {
        return e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/'/g, "&#039;").replace(/"/g, "&quot;").replace(/\n/g, "<br />")
    }

    function V(e) {
        return e.id + "/" + e.className + "/" + e.style.cssText.replace(/(^|;)\s*(top|left|width|height)\s*:[^;]*/ig, "")
    }

    function $(e) {
        e.attr("unselectable", "on").css("MozUserSelect", "none").bind("selectstart.ui", function () {
            return !1
        })
    }

    function J(e) {
        e.children().removeClass("fc-first fc-last").filter(":first-child").addClass("fc-first").end().filter(":last-child").addClass("fc-last")
    }

    function K(e, t) {
        e.each(function (e, n) {
            n.className = n.className.replace(/^fc-\w*/, "fc-" + xt[t.getDay()])
        })
    }

    function Q(e, t) {
        var n = e.source || {}, r = e.color,
            i = n.color,
            s = t("eventColor"),
            o = e.backgroundColor || r || n.backgroundColor || i || t("eventBackgroundColor") || s;
        return r = e.borderColor || r || n.borderColor || i || t("eventBorderColor") || s, e = e.textColor || n.textColor || t("eventTextColor"), t = [], o && t.push("background-color:" + o), r && t.push("border-color:" + r), e && t.push("color:" + e), t.join(";")
    }

    function G(t, n, r) {
        e.isFunction(t) && (t = [t]);
        if (t) {
            var i, s;
            for (i = 0; i < t.length; i++) s = t[i].apply(n, r) || s;
            return s
        }
    }

    function Y() {
        for (var e = 0; e < arguments.length; e++)
            if (arguments[e] !== t) return arguments[e]
    }

    function Z(e, t) {
        function n(e, t) {
            t && (u(e, t), e.setDate(1)), e = h(e, !0), e.setDate(1), t = u(h(e), 1);
            var n = h(e),
                f = h(t),
                l = i("firstDay"),
                c = i("weekends") ? 0 : 1;
            c && (d(n), d(f, -1, !0)), a(n, -((n.getDay() - Math.max(l, c) + 7) % 7)), a(f, (7 - f.getDay() + Math.max(l, c)) % 7), l = Math.round((f - n) / (Tt * 7)), i("weekMode") == "fixed" && (a(f, (6 - l) * 7), l = 6), r.title = o(e, i("titleFormat")), r.start = e, r.end = t, r.visStart = n, r.visEnd = f, s(6, l, c ? 5 : 7, !0)
        }
        var r = this;
        r.render = n, nt.call(r, e, t, "month");
        var i = r.opt,
            s = r.renderBasic,
            o = t.formatDate
    }

    function et(e, t) {
        function n(e, t) {
            t && a(e, t * 7), e = a(h(e), -((e.getDay() - i("firstDay") + 7) % 7)), t = a(h(e), 7);
            var n = h(e),
                u = h(t),
                f = i("weekends");
            f || (d(n), d(u, -1, !0)), r.title = o(n, a(h(u), -1), i("titleFormat")), r.start = e, r.end = t, r.visStart = n, r.visEnd = u, s(1, 1, f ? 7 : 5, !1)
        }
        var r = this;
        r.render = n, nt.call(r, e, t, "basicWeek");
        var i = r.opt,
            s = r.renderBasic,
            o = t.formatDates
    }

    function tt(e, t) {
        function n(e, t) {
            t && (a(e, t), i("weekends") || d(e, t < 0 ? -1 : 1)), r.title = o(e, i("titleFormat")), r.start = r.visStart = h(e, !0), r.end = r.visEnd = a(h(r.start), 1), s(1, 1, 1, !1)
        }
        var r = this;
        r.render = n, nt.call(r, e, t, "basicDay");
        var i = r.opt,
            s = r.renderBasic,
            o = t.formatDate
    }

    function nt(t, n, r) {
        function i(e, t, n, r) {
            ot = t, ut = n, s(), (t = !Q) ? o(e, r) : q(), u(t)
        }

        function s() {
            (gt = j("isRTL")) ? (yt = -1, bt = ut - 1) : (yt = 1, bt = 0), wt = j("firstDay"), Et = j("weekends") ? 0 : 1, St = j("theme") ? "ui" : "fc", xt = j("columnFormat")
        }

        function o(n, r) {
            var i, s = St + "-widget-header",
                o = St + "-widget-content",
                u;
            i = "<table class='fc-border-separate' style='width:100%' cellspacing='0'><thead><tr>";
            for (u = 0; u < ut; u++) i += "<th class='fc- " + s + "'/>";
            i += "</tr></thead><tbody>";
            for (u = 0; u < n; u++) {
                i += "<tr class='fc-week" + u + "'>";
                for (s = 0; s < ut; s++) i += "<td class='fc- " + o + " fc-day" + (u * ut + s) + "'><div>" + (r ? "<div class='fc-day-number'/>" : "") + "<div class='fc-day-content'><div style='position:relative'>&nbsp;</div></div></div></td>";
                i += "</tr>"
            }
            i += "</tbody></table>", n = e(i).appendTo(t), X = n.find("thead"), V = X.find("th"), Q = n.find("tbody"), G = Q.find("tr"), Y = Q.find("td"), Z = Y.filter(":first-child"), et = G.eq(0).find("div.fc-day-content div"), J(X.add(X.find("tr"))), J(G), G.eq(0).addClass("fc-first"), p(Y), tt = e("<div style='position:absolute;z-index:8;top:0;left:0'/>").appendTo(t)
        }

        function u(t) {
            var n = t || ot == 1,
                r = B.start.getMonth(),
                i = c(new Date),
                s, o, u;
            n && V.each(function (t, n) {
                s = e(n), o = M(t), s.html(W(o, xt)), K(s, o)
            }), Y.each(function (t, u) {
                s = e(u), o = M(t), o.getMonth() == r ? s.removeClass("fc-other-month") : s.addClass("fc-other-month"), +o == +i ? s.addClass(St + "-state-highlight fc-today") : s.removeClass(St + "-state-highlight fc-today"), s.find("div.fc-day-number").text(o.getDate()), n && K(s, o)
            }), G.each(function (t, n) {
                u = e(n), t < ot ? (u.show(), t == ot - 1 ? u.addClass("fc-last") : u.removeClass("fc-last")) : u.hide()
            })
        }

        function f(t) {
            it = t, t = it - X.height();
            var n, r, i;
            j("weekMode") == "variable" ? n = r = Math.floor(t / (ot == 1 ? 2 : 6)) : (n = Math.floor(t / ot), r = t - n * (ot - 1)), Z.each(function (t, s) {
                t < ot && (i = e(s), I(i.find("> div"), (t == ot - 1 ? r : n) - H(i)))
            })
        }

        function l(e) {
            nt = e, vt.clear(), st = Math.floor(nt / ut), A(V.slice(0, -1), st)
        }

        function p(e) {
            e.click(d).mousedown(z)
        }

        function d(e) {
            if (!j("selectable")) {
                var t = parseInt(this.className.match(/fc\-day(\d+)/)[1]);
                t = M(t), F("dayClick", this, t, !0, e)
            }
        }

        function m(e, t, n) {
            n && at.build(), n = h(B.visStart);
            for (var r = a(h(n), ut), i = 0; i < ot; i++) {
                var s = new Date(Math.max(n, e)),
                    o = new Date(Math.min(r, t));
                if (s < o) {
                    var u;
                    gt ? (u = v(o, n) * yt + bt + 1, s = v(s, n) * yt + bt + 1) : (u = v(s, n), s = v(o, n)), p(g(i, u, i, s - 1))
                }
                a(n, 7), a(r, 7)
            }
        }

        function g(e, n, r, i) {
            return e = at.rect(e, n, r, i, t), R(e, t)
        }

        function y(e) {
            return h(e)
        }

        function b(e, t) {
            m(e, a(h(t), 1), !0)
        }

        function w() {
            U()
        }

        function E(e, t, n) {
            var r = k(e);
            F("dayClick", Y[r.row * ut + r.col], e, t, n)
        }

        function S(e, t) {
            lt.start(function (e) {
                U(), e && g(e.row, e.col, e.row, e.col)
            }, t)
        }

        function x(e, t, n) {
            var r = lt.stop();
            U(), r && (r = L(r), F("drop", e, r, !0, t, n))
        }

        function T(e) {
            return h(e.start)
        }

        function N(e) {
            return vt.left(e)
        }

        function C(e) {
            return vt.right(e)
        }

        function k(e) {
            return {
                row: Math.floor(v(e, B.visStart) / 7),
                col: _(e.getDay())
            }
        }

        function L(e) {
            return O(e.row, e.col)
        }

        function O(e, t) {
            return a(h(B.visStart), e * 7 + t * yt + bt)
        }

        function M(e) {
            return O(Math.floor(e / ut), e % ut)
        }

        function _(e) {
            return (e - Math.max(wt, Et) + ut) % ut * yt + bt
        }

        function D(e) {
            return G.eq(e)
        }

        function P() {
            return {
                left: 0,
                right: nt
            }
        }
        var B = this;
        B.renderBasic = i, B.setHeight = f, B.setWidth = l, B.renderDayOverlay = m, B.defaultSelectionEnd = y, B.renderSelection = b, B.clearSelection = w, B.reportDayClick = E, B.dragStart = S, B.dragStop = x, B.defaultEventEnd = T, B.getHoverListener = function () {
            return lt
        }, B.colContentLeft = N, B.colContentRight = C, B.dayOfWeekCol = _, B.dateCell = k, B.cellDate = L, B.cellIsAllDay = function () {
            return !0
        }, B.allDayRow = D, B.allDayBounds = P, B.getRowCnt = function () {
            return ot
        }, B.getColCnt = function () {
            return ut
        }, B.getColWidth = function () {
            return st
        }, B.getDaySegmentContainer = function () {
            return tt
        }, ft.call(B, t, n, r), ht.call(B), ct.call(B), rt.call(B);
        var j = B.opt,
            F = B.trigger,
            q = B.clearEvents,
            R = B.renderOverlay,
            U = B.clearOverlays,
            z = B.daySelectionMousedown,
            W = n.formatDate,
            X, V, Q, G, Y, Z, et, tt, nt, it, st, ot, ut, at, lt, vt, gt, yt, bt, wt, Et, St, xt;
        $(t.addClass("fc-grid")), at = new pt(function (t, n) {
            var r, i, s;
            V.each(function (t, o) {
                r = e(o), i = r.offset().left, t && (s[1] = i), s = [i], n[t] = s
            }), s[1] = i + r.outerWidth(), G.each(function (n, o) {
                n < ot && (r = e(o), i = r.offset().top, n && (s[1] = i), s = [i], t[n] = s)
            }), s[1] = i + r.outerHeight()
        }), lt = new dt(at), vt = new mt(function (e) {
            return et.eq(e)
        })
    }

    function rt() {
        function t(e, t) {
            p(e), L(r(e), t)
        }

        function n() {
            d(), b().empty()
        }

        function r(t) {
            var n = T(),
                r = N(),
                i = h(o.visStart);
            r = a(h(i), r);
            var s = e.map(t, S),
                u, f, l, c, p, d, v = [];
            for (u = 0; u < n; u++) {
                f = k(C(t, s, i, r));
                for (l = 0; l < f.length; l++) {
                    c = f[l];
                    for (p = 0; p < c.length; p++) d = c[p], d.row = u, d.level = l, v.push(d)
                }
                a(i, 7), a(r, 7)
            }
            return v
        }

        function i(e, t, n) {
            l(e) && s(e, t), n.isEnd && c(e) && A(e, t, n), v(e, t)
        }

        function s(e, t) {
            var n = w(),
                r;
            t.draggable({
                zIndex: 9,
                delay: 50,
                opacity: u("dragOpacity"),
                revertDuration: u("dragRevertDuration"),
                start: function (i, s) {
                    f("eventDragStart", t, e, i, s), g(e, t), n.start(function (n, i, s, o) {
                        t.draggable("option", "revert", !n || !s && !o), x(), n ? (r = s * 7 + o * (u("isRTL") ? -1 : 1), E(a(h(e.start), r), a(S(e), r))) : r = 0
                    }, i, "drag")
                },
                stop: function (i, s) {
                    n.stop(), x(), f("eventDragStop", t, e, i, s), r ? y(this, e, r, 0, e.allDay, i, s) : (t.css("filter", ""), m(e, t))
                }
            })
        }
        var o = this;
        o.renderEvents = t, o.compileDaySegs = r, o.clearEvents = n, o.bindDaySeg = i, lt.call(o);
        var u = o.opt,
            f = o.trigger,
            l = o.isEventDraggable,
            c = o.isEventResizable,
            p = o.reportEvents,
            d = o.reportEventClear,
            v = o.eventElementHandlers,
            m = o.showEvents,
            g = o.hideEvents,
            y = o.eventDrop,
            b = o.getDaySegmentContainer,
            w = o.getHoverListener,
            E = o.renderDayOverlay,
            x = o.clearOverlays,
            T = o.getRowCnt,
            N = o.getColCnt,
            L = o.renderDaySegs,
            A = o.resizableDayEvent
    }

    function it(e, t) {
        function n(e, t) {
            t && a(e, t * 7), e = a(h(e), -((e.getDay() - i("firstDay") + 7) % 7)), t = a(h(e), 7);
            var n = h(e),
                u = h(t),
                f = i("weekends");
            f || (d(n), d(u, -1, !0)), r.title = o(n, a(h(u), -1), i("titleFormat")), r.start = e, r.end = t, r.visStart = n, r.visEnd = u, s(f ? 7 : 5)
        }
        var r = this;
        r.render = n, ot.call(r, e, t, "agendaWeek");
        var i = r.opt,
            s = r.renderAgenda,
            o = t.formatDates
    }

    function st(e, t) {
        function n(e, t) {
            t && (a(e, t), i("weekends") || d(e, t < 0 ? -1 : 1)), t = h(e, !0);
            var n = a(h(t), 1);
            r.title = o(e, i("titleFormat")), r.start = r.visStart = t, r.end = r.visEnd = n, s(1)
        }
        var r = this;
        r.render = n, ot.call(r, e, t, "agendaDay");
        var i = r.opt,
            s = r.renderAgenda,
            o = t.formatDate
    }

    function ot(n, r, i) {
        function s(e) {
            Wt = e, o(), gt ? nt() : u(), f()
        }

        function o() {
            Qt = et("theme") ? "ui" : "fc", Yt = et("weekends") ? 0 : 1, Gt = et("firstDay"), (Zt = et("isRTL")) ? (en = -1, tn = Wt - 1) : (en = 1, tn = 0), nn = b(et("minTime")), rn = b(et("maxTime")), sn = et("columnFormat")
        }

        function u() {
            var t = Qt + "-widget-header",
                r = Qt + "-widget-content",
                i, s, o, u, a, f = et("slotMinutes") % 15 == 0;
            i = "<table style='width:100%' class='fc-agenda-days fc-border-separate' cellspacing='0'><thead><tr><th class='fc-agenda-axis " + t + "'>&nbsp;</th>";
            for (s = 0; s < Wt; s++) i += "<th class='fc- fc-col" + s + " " + t + "'/>";
            i += "<th class='fc-agenda-gutter " + t + "'>&nbsp;</th></tr></thead><tbody><tr><th class='fc-agenda-axis " + t + "'>&nbsp;</th>";
            for (s = 0; s < Wt; s++) i += "<td class='fc- fc-col" + s + " " + r + "'><div><div class='fc-day-content'><div style='position:relative'>&nbsp;</div></div></div></td>";
            i += "<td class='fc-agenda-gutter " + r + "'>&nbsp;</td></tr></tbody></table>", gt = e(i).appendTo(n), yt = gt.find("thead"), bt = yt.find("th").slice(1, -1), wt = gt.find("tbody"), Et = wt.find("td").slice(0, -1), St = Et.find("div.fc-day-content div"), xt = Et.eq(0), Tt = xt.find("> div"), J(yt.add(yt.find("tr"))), J(wt.add(wt.find("tr"))), Pt = yt.find("th:first"), Ht = gt.find(".fc-agenda-gutter"), Nt = e("<div style='position:absolute;z-index:2;left:0;width:100%'/>").appendTo(n), et("allDaySlot") ? (Ct = e("<div style='position:absolute;z-index:8;top:0;left:0'/>").appendTo(Nt), i = "<table style='width:100%' class='fc-agenda-allday' cellspacing='0'><tr><th class='" + t + " fc-agenda-axis'>" + et("allDayText") + "</th><td><div class='fc-day-content'><div style='position:relative'/></div></td><th class='" + t + " fc-agenda-gutter'>&nbsp;</th></tr></table>", kt = e(i).appendTo(Nt), Lt = kt.find("tr"), E(Lt.find("td")), Pt = Pt.add(kt.find("th:first")), Ht = Ht.add(kt.find("th.fc-agenda-gutter")), Nt.append("<div class='fc-agenda-divider " + t + "'><div class='fc-agenda-divider-inner'/></div>")) : Ct = e([]), At = e("<div style='position:absolute;width:100%;overflow-x:hidden;overflow-y:auto'/>").appendTo(Nt), Ot = e("<div style='position:relative;width:100%;overflow:hidden'/>").appendTo(At), Mt = e("<div style='position:absolute;z-index:8;top:0;left:0'/>").appendTo(Ot), i = "<table class='fc-agenda-slots' style='width:100%' cellspacing='0'><tbody>", o = p(), u = l(h(o), rn), l(o, nn);
            for (s = Xt = 0; o < u; s++) a = o.getMinutes(), i += "<tr class='fc-slot" + s + " " + (a ? "fc-minor" : "") + "'><th class='fc-agenda-axis " + t + "'>" + (!f || !a ? vt(o, et("axisFormat")) : "&nbsp;") + "</th><td class='" + r + "'><div style='position:relative'>&nbsp;</div></td></tr>", l(o, et("slotMinutes")), Xt++;
            i += "</tbody></table>", _t = e(i).appendTo(Ot), Dt = _t.find("div:first"), S(_t.find("td")), Pt = Pt.add(_t.find("th:first"))
        }

        function f() {
            var e, t, n, r, i = c(new Date);
            for (e = 0; e < Wt; e++) r = D(e), t = bt.eq(e), t.html(vt(r, sn)), n = Et.eq(e), +r == +i ? n.addClass(Qt + "-state-highlight fc-today") : n.removeClass(Qt + "-state-highlight fc-today"), K(t.add(n), r)
        }

        function d(e, n) {
            e === t && (e = Ft), Ft = e, Kt = {};
            var r = wt.position().top,
                i = At.position().top;
            e = Math.min(e - r, _t.height() + i + 1), Tt.height(e - H(xt)), Nt.css("top", r), At.height(e - i - 1), Ut = Dt.height() + 1, n && g()
        }

        function m(t) {
            jt = t, Jt.clear(), It = 0, A(Pt.width("").each(function (t, n) {
                It = Math.max(It, e(n).outerWidth())
            }), It), t = At[0].clientWidth, (Rt = At.width() - t) ? (A(Ht, Rt), Ht.show().prev().removeClass("fc-last")) : Ht.hide().prev().addClass("fc-last"), qt = Math.floor((t - It) / Wt), A(bt.slice(0, -1), qt)
        }

        function g() {
            function e() {
                At.scrollTop(r)
            }
            var t = p(),
                n = h(t);
            n.setHours(et("firstHour"));
            var r = j(t, n) + 1;
            e(), setTimeout(e, 0)
        }

        function y() {
            zt = At.scrollTop()
        }

        function w() {
            At.scrollTop(zt)
        }

        function E(e) {
            e.click(x).mousedown(at)
        }

        function S(e) {
            e.click(x).mousedown(V)
        }

        function x(e) {
            if (!et("selectable")) {
                var t = Math.min(Wt - 1, Math.floor((e.pageX - gt.offset().left - It) / qt)),
                    n = D(t),
                    r = this.parentNode.className.match(/fc-slot(\d+)/);
                if (r) {
                    r = parseInt(r[1]) * et("slotMinutes");
                    var i = Math.floor(r / 60);
                    n.setHours(i), n.setMinutes(r % 60 + nn), tt("dayClick", Et[t], n, !1, e)
                } else tt("dayClick", Et[t], n, !0, e)
            }
        }

        function T(e, t, n) {
            n && Vt.build();
            var r = h(Z.visStart);
            Zt ? (n = v(t, r) * en + tn + 1, e = v(e, r) * en + tn + 1) : (n = v(e, r), e = v(t, r)), n = Math.max(0, n), e = Math.min(Wt, e), n < e && E(N(0, n, 0, e - 1))
        }

        function N(e, t, n, r) {
            return e = Vt.rect(e, t, n, r, Nt), rt(e, Nt)
        }

        function C(e, t) {
            for (var n = h(Z.visStart), r = a(h(n), 1), i = 0; i < Wt; i++) {
                var s = new Date(Math.max(n, e)),
                    o = new Date(Math.min(r, t));
                if (s < o) {
                    var u = i * en + tn;
                    u = Vt.rect(0, u, 0, u, Ot), s = j(n, s), o = j(n, o), u.top = s, u.height = o - s, S(rt(u, Ot))
                }
                a(n, 1), a(r, 1)
            }
        }

        function k(e) {
            return Jt.left(e)
        }

        function L(e) {
            return Jt.right(e)
        }

        function M(e) {
            return {
                row: Math.floor(v(e, Z.visStart) / 7),
                col: B(e.getDay())
            }
        }

        function _(e) {
            var t = D(e.col);
            return e = e.row, et("allDaySlot") && e--, e >= 0 && l(t, nn + e * et("slotMinutes")), t
        }

        function D(e) {
            return a(h(Z.visStart), e * en + tn)
        }

        function P(e) {
            return et("allDaySlot") && !e.row
        }

        function B(e) {
            return (e - Math.max(Gt, Yt) + Wt) % Wt * en + tn
        }

        function j(e, n) {
            e = h(e, !0);
            if (n < l(h(e), nn)) return 0;
            if (n >= l(h(e), rn)) return _t.height();
            e = et("slotMinutes"), n = n.getHours() * 60 + n.getMinutes() - nn;
            var r = Math.floor(n / e),
                i = Kt[r];
            return i === t && (i = Kt[r] = _t.find("tr:eq(" + r + ") td div")[0].offsetTop), Math.max(0, Math.round(i - 1 + Ut * (n % e / e)))
        }

        function F() {
            return {
                left: It,
                right: jt - Rt
            }
        }

        function I() {
            return Lt
        }

        function q(e) {
            var t = h(e.start);
            return e.allDay ? t : l(t, et("defaultEventMinutes"))
        }

        function U(e, t) {
            return t ? h(e) : l(h(e), et("slotMinutes"))
        }

        function z(e, t, n) {
            n ? et("allDaySlot") && T(e, a(h(t), 1), !0) : W(e, t)
        }

        function W(t, n) {
            var r = et("selectHelper");
            Vt.build();
            if (r) {
                var i = v(t, Z.visStart) * en + tn;
                if (i >= 0 && i < Wt) {
                    i = Vt.rect(0, i, 0, i, Ot);
                    var s = j(t, t),
                        o = j(t, n);
                    if (o > s) {
                        i.top = s, i.height = o - s, i.left += 2, i.width -= 5;
                        if (e.isFunction(r)) {
                            if (t = r(t, n)) i.position = "absolute", i.zIndex = 8, Bt = e(t).css(i).appendTo(Ot)
                        } else i.isStart = !0, i.isEnd = !0, Bt = e(lt({
                            title: "",
                            start: t,
                            end: n,
                            className: ["fc-select-helper"],
                            editable: !1
                        }, i)), Bt.css("opacity", et("dragOpacity"));
                        Bt && (S(Bt), Ot.append(Bt), A(Bt, i.width, !0), O(Bt, i.height, !0))
                    }
                }
            } else C(t, n)
        }

        function X() {
            it(), Bt && (Bt.remove(), Bt = null)
        }

        function V(t) {
            if (t.which == 1 && et("selectable")) {
                ot(t);
                var n;
                $t.start(function (e, t) {
                    X(), e && e.col == t.col && !P(e) ? (t = _(t), e = _(e), n = [t, l(h(t), et("slotMinutes")), e, l(h(e), et("slotMinutes"))].sort(R), W(n[0], n[3])) : n = null
                }, t), e(document).one("mouseup", function (e) {
                    $t.stop(), n && (+n[0] == +n[1] && Q(n[0], !1, e), st(n[0], n[3], !1, e))
                })
            }
        }

        function Q(e, t, n) {
            tt("dayClick", Et[B(e.getDay())], e, t, n)
        }

        function G(e, t) {
            $t.start(function (e) {
                it();
                if (e)
                    if (P(e)) N(e.row, e.col, e.row, e.col);
                    else {
                        e = _(e);
                        var t = l(h(e), et("defaultEventMinutes"));
                        C(e, t)
                    }
            }, t)
        }

        function Y(e, t, n) {
            var r = $t.stop();
            it(), r && tt("drop", e, _(r), P(r), t, n)
        }
        var Z = this;
        Z.renderAgenda = s, Z.setWidth = m, Z.setHeight = d, Z.beforeHide = y, Z.afterShow = w, Z.defaultEventEnd = q, Z.timePosition = j, Z.dayOfWeekCol = B, Z.dateCell = M, Z.cellDate = _, Z.cellIsAllDay = P, Z.allDayRow = I, Z.allDayBounds = F, Z.getHoverListener = function () {
            return $t
        }, Z.colContentLeft = k, Z.colContentRight = L, Z.getDaySegmentContainer = function () {
            return Ct
        }, Z.getSlotSegmentContainer = function () {
            return Mt
        }, Z.getMinMinute = function () {
            return nn
        }, Z.getMaxMinute = function () {
            return rn
        }, Z.getBodyContent = function () {
            return Ot
        }, Z.getRowCnt = function () {
            return 1
        }, Z.getColCnt = function () {
            return Wt
        }, Z.getColWidth = function () {
            return qt
        }, Z.getSlotHeight = function () {
            return Ut
        }, Z.defaultSelectionEnd = U, Z.renderDayOverlay = T, Z.renderSelection = z, Z.clearSelection = X, Z.reportDayClick = Q, Z.dragStart = G, Z.dragStop = Y, ft.call(Z, n, r, i), ht.call(Z), ct.call(Z), ut.call(Z);
        var et = Z.opt,
            tt = Z.trigger,
            nt = Z.clearEvents,
            rt = Z.renderOverlay,
            it = Z.clearOverlays,
            st = Z.reportSelection,
            ot = Z.unselect,
            at = Z.daySelectionMousedown,
            lt = Z.slotSegHtml,
            vt = r.formatDate,
            gt, yt, bt, wt, Et, St, xt, Tt, Nt, Ct, kt, Lt, At, Ot, Mt, _t, Dt, Pt, Ht, Bt, jt, Ft, It, qt, Rt, Ut, zt, Wt, Xt, Vt, $t, Jt, Kt = {}, Qt, Gt, Yt, Zt, en, tn, nn, rn, sn;
        $(n.addClass("fc-agenda")), Vt = new pt(function (t, n) {
            function r(e) {
                return Math.max(a, Math.min(f, e))
            }
            var i, s, o;
            bt.each(function (t, r) {
                i = e(r), s = i.offset().left, t && (o[1] = s), o = [s], n[t] = o
            }), o[1] = s + i.outerWidth(), et("allDaySlot") && (i = Lt, s = i.offset().top, t[0] = [s, s + i.outerHeight()]);
            for (var u = Ot.offset().top, a = At.offset().top, f = a + At.outerHeight(), l = 0; l < Xt; l++) t.push([r(u + Ut * l), r(u + Ut * (l + 1))])
        }), $t = new dt(Vt), Jt = new mt(function (e) {
            return St.eq(e)
        })
    }

    function ut() {
        function n(e, t) {
            T(e);
            var n, r = e.length,
                o = [],
                a = [];
            for (n = 0; n < r; n++) e[n].allDay ? o.push(e[n]) : a.push(e[n]);
            y("allDaySlot") && (U(i(o), t), _()), u(s(a), t)
        }

        function r() {
            N(), D().empty(), P().empty()
        }

        function i(t) {
            t = k(C(t, e.map(t, S), g.visStart, g.visEnd));
            var n, r = t.length,
                i, s, o, u = [];
            for (n = 0; n < r; n++) {
                i = t[n];
                for (s = 0; s < i.length; s++) o = i[s], o.row = 0, o.level = n, u.push(o)
            }
            return u
        }

        function s(t) {
            var n = W(),
                r = F(),
                i = j(),
                s = l(h(g.visStart), r),
                u = e.map(t, o),
                f, c, p, d, v, m, y = [];
            for (f = 0; f < n; f++) {
                c = k(C(t, u, s, l(h(s), i - r))), at(c);
                for (p = 0; p < c.length; p++) {
                    d = c[p];
                    for (v = 0; v < d.length; v++) m = d[v], m.col = f, m.level = p, y.push(m)
                }
                a(s, 1, !0)
            }
            return y
        }

        function o(e) {
            return e.end ? h(e.end) : l(h(e.start), y("defaultEventMinutes"))
        }

        function u(n, r) {
            var i, s = n.length,
                o, u, a, l, c, h, d, v, m, g = "",
                w, E, S = {}, x = {}, T = P(),
                N;
            i = W(), (w = y("isRTL")) ? (E = -1, N = i - 1) : (E = 1, N = 0);
            for (i = 0; i < s; i++) o = n[i], u = o.event, a = I(o.start, o.start), l = I(o.start, o.end), c = o.col, h = o.level, d = o.forward || 0, v = q(c * E + N), m = R(c * E + N) - v, m = Math.min(m - 6, m * .95), c = h ? m / (h + d + 1) : d ? (m / (d + 1) - 6) * 2 : m, h = v + m / (h + d + 1) * h * E + (w ? m - c : 0), o.top = a, o.left = h, o.outerWidth = c, o.outerHeight = l - a, g += f(u, o);
            T[0].innerHTML = g, w = T.children();
            for (i = 0; i < s; i++) o = n[i], u = o.event, g = e(w[i]), E = b("eventRender", u, u, g), E === !1 ? g.remove() : (E && E !== !0 && (g.remove(), g = e(E).css({
                position: "absolute",
                top: o.top,
                left: o.left
            }).appendTo(T)), o.element = g, u._id === r ? p(u, g, o) : g[0]._fci = i, G(u, g));
            L(T, n, p);
            for (i = 0; i < s; i++) {
                o = n[i];
                if (g = o.element) u = S[r = o.key = V(g[0])], o.vsides = u === t ? S[r] = H(g, !0) : u, u = x[r], o.hsides = u === t ? x[r] = M(g, !0) : u, r = g.find("div.fc-event-content"), r.length && (o.contentTop = r[0].offsetTop)
            }
            for (i = 0; i < s; i++) {
                o = n[i];
                if (g = o.element) g[0].style.width = Math.max(0, o.outerWidth - o.hsides) + "px", S = Math.max(0, o.outerHeight - o.vsides), g[0].style.height = S + "px", u = o.event, o.contentTop !== t && S - o.contentTop < 10 && (g.find("div.fc-event-time").text(st(u.start, y("timeFormat")) + " - " + u.title), g.find("div.fc-event-title").remove()), b("eventAfterRender", u, u, g)
            }
        }

        function f(e, t) {
            var n = "<",
                r = e.url,
                i = Q(e, y),
                s = i ? " style='" + i + "'" : "",
                o = ["fc-event", "fc-event-skin", "fc-event-vert"];
            return w(e) && o.push("fc-event-draggable"), t.isStart && o.push("fc-corner-top"), t.isEnd && o.push("fc-corner-bottom"), o = o.concat(e.className), e.source && (o = o.concat(e.source.className || [])), n += r ? "a href='" + X(e.url) + "'" : "div", n += " class='" + o.join(" ") + "' style='position:absolute;z-index:8;top:" + t.top + "px;left:" + t.left + "px;" + i + "'><div class='fc-event-inner fc-event-skin'" + s + "><div class='fc-event-head fc-event-skin'" + s + "><div class='fc-event-time'>" + X(ot(e.start, e.end, y("timeFormat"))) + "</div></div><div class='fc-event-content'><div class='fc-event-title'>" + X(e.title) + "</div></div><div class='fc-event-bg'></div></div>", t.isEnd && E(e) && (n += "<div class='ui-resizable-handle ui-resizable-s'>=</div>"), n += "</" + (r ? "a" : "div") + ">", n
        }

        function c(e, t, n) {
            w(e) && d(e, t, n.isStart), n.isEnd && E(e) && z(e, t, n), A(e, t)
        }

        function p(e, t, n) {
            var r = t.find("div.fc-event-time");
            w(e) && v(e, t, r), n.isEnd && E(e) && m(e, t, r), A(e, t)
        }

        function d(e, t, n) {
            function r() {
                o || (t.width(i).height("").draggable("option", "grid", null), o = !0)
            }
            var i, s, o = !0,
                u, f = y("isRTL") ? -1 : 1,
                l = B(),
                c = $(),
                p = J(),
                d = F();
            t.draggable({
                zIndex: 9,
                opacity: y("dragOpacity", "month"),
                revertDuration: y("dragRevertDuration"),
                start: function (d, v) {
                    b("eventDragStart", t, e, d, v), Z(e, t), i = t.width(), l.start(function (i, l, d, v) {
                        rt(), i ? (s = !1, u = v * f, i.row ? n ? o && (t.width(c - 10), O(t, p * Math.round((e.end ? (e.end - e.start) / Ct : y("defaultEventMinutes")) / y("slotMinutes"))), t.draggable("option", "grid", [c, 1]), o = !1) : s = !0 : (nt(a(h(e.start), u), a(S(e), u)), r()), s = s || o && !u) : (r(), s = !0), t.draggable("option", "revert", s)
                    }, d, "drag")
                },
                stop: function (n, i) {
                    l.stop(), rt(), b("eventDragStop", t, e, n, i);
                    if (s) r(), t.css("filter", ""), Y(e, t);
                    else {
                        var a = 0;
                        o || (a = Math.round((t.offset().top - K().offset().top) / p) * y("slotMinutes") + d - (e.start.getHours() * 60 + e.start.getMinutes())), et(this, e, u, a, o, n, i)
                    }
                }
            })
        }

        function v(e, t, n) {
            function r(t) {
                var r = l(h(e.start), t),
                    i;
                e.end && (i = l(h(e.end), t)), n.text(ot(r, i, y("timeFormat")))
            }

            function i() {
                o && (n.css("display", ""), t.draggable("option", "grid", [m, g]), o = !1)
            }
            var s, o = !1,
                u, f, c, p = y("isRTL") ? -1 : 1,
                d = B(),
                v = W(),
                m = $(),
                g = J();
            t.draggable({
                zIndex: 9,
                scroll: !1,
                grid: [m, g],
                axis: v == 1 ? "y" : !1,
                opacity: y("dragOpacity"),
                revertDuration: y("dragRevertDuration"),
                start: function (r, l) {
                    b("eventDragStart", t, e, r, l), Z(e, t), s = t.position(), f = c = 0, d.start(function (r, s, f, l) {
                        t.draggable("option", "revert", !r), rt(), r && (u = l * p, y("allDaySlot") && !r.row ? (o || (o = !0, n.hide(), t.draggable("option", "grid", null)), nt(a(h(e.start), u), a(S(e), u))) : i())
                    }, r, "drag")
                },
                drag: function (e, t) {
                    f = Math.round((t.position.top - s.top) / g) * y("slotMinutes"), f != c && (o || r(f), c = f)
                },
                stop: function (n, a) {
                    var l = d.stop();
                    rt(), b("eventDragStop", t, e, n, a), l && (u || f || o) ? et(this, e, u, o ? 0 : f, o, n, a) : (i(), t.css("filter", ""), t.css(s), r(0), Y(e, t))
                }
            })
        }

        function m(e, t, n) {
            var r, i, s = J();
            t.resizable({
                handles: {
                    s: "div.ui-resizable-s"
                },
                grid: s,
                start: function (n, s) {
                    r = i = 0, Z(e, t), t.css("z-index", 9), b("eventResizeStart", this, e, n, s)
                },
                resize: function (o, u) {
                    r = Math.round((Math.max(s, t.height()) - u.originalSize.height) / s), r != i && (n.text(ot(e.start, !r && !e.end ? null : l(x(e), y("slotMinutes") * r), y("timeFormat"))), i = r)
                },
                stop: function (n, i) {
                    b("eventResizeStop", this, e, n, i), r ? tt(this, e, 0, y("slotMinutes") * r, n, i) : (t.css("z-index", 8), Y(e, t))
                }
            })
        }
        var g = this;
        g.renderEvents = n, g.compileDaySegs = i, g.clearEvents = r, g.slotSegHtml = f, g.bindDaySeg = c, lt.call(g);
        var y = g.opt,
            b = g.trigger,
            w = g.isEventDraggable,
            E = g.isEventResizable,
            x = g.eventEnd,
            T = g.reportEvents,
            N = g.reportEventClear,
            A = g.eventElementHandlers,
            _ = g.setHeight,
            D = g.getDaySegmentContainer,
            P = g.getSlotSegmentContainer,
            B = g.getHoverListener,
            j = g.getMaxMinute,
            F = g.getMinMinute,
            I = g.timePosition,
            q = g.colContentLeft,
            R = g.colContentRight,
            U = g.renderDaySegs,
            z = g.resizableDayEvent,
            W = g.getColCnt,
            $ = g.getColWidth,
            J = g.getSlotHeight,
            K = g.getBodyContent,
            G = g.reportEventElement,
            Y = g.showEvents,
            Z = g.hideEvents,
            et = g.eventDrop,
            tt = g.eventResize,
            nt = g.renderDayOverlay,
            rt = g.clearOverlays,
            it = g.calendar,
            st = it.formatDate,
            ot = it.formatDates
    }

    function at(e) {
        var t, n, r, i, s, o;
        for (t = e.length - 1; t > 0; t--) {
            i = e[t];
            for (n = 0; n < i.length; n++) {
                s = i[n];
                for (r = 0; r < e[t - 1].length; r++) o = e[t - 1][r], N(s, o) && (o.forward = Math.max(o.forward || 0, (s.forward || 0) + 1))
            }
        }
    }

    function ft(e, n, r) {
        function i(e, t) {
            return e = M[e], typeof e == "object" ? W(e, t || r) : e
        }

        function s(e, t) {
            return n.trigger.apply(n, [e, t || T].concat(Array.prototype.slice.call(arguments, 2), [T]))
        }

        function o(e) {
            return f(e) && !i("disableDragging")
        }

        function u(e) {
            return f(e) && !i("disableResizing")
        }

        function f(e) {
            return Y(e.editable, (e.source || {}).editable, i("editable"))
        }

        function c(e) {
            L = {};
            var t, n = e.length,
                r;
            for (t = 0; t < n; t++) r = e[t], L[r._id] ? L[r._id].push(r) : L[r._id] = [r]
        }

        function p(e) {
            return e.end ? h(e.end) : N(e)
        }

        function d(e, t) {
            A.push(t), O[e._id] ? O[e._id].push(t) : O[e._id] = [t]
        }

        function v() {
            A = [], O = {}
        }

        function m(e, t) {
            t.click(function (n) {
                if (!t.hasClass("ui-draggable-dragging") && !t.hasClass("ui-resizable-resizing")) return s("eventClick", this, e, n)
            }).hover(function (t) {
                s("eventMouseover", this, e, t)
            }, function (t) {
                s("eventMouseout", this, e, t)
            })
        }

        function g(e, t) {
            b(e, t, "show")
        }

        function y(e, t) {
            b(e, t, "hide")
        }

        function b(e, t, n) {
            e = O[e._id];
            var r, i = e.length;
            for (r = 0; r < i; r++)(!t || e[r][0] != t[0]) && e[r][n]()
        }

        function w(e, t, n, r, i, o, u) {
            var a = t.allDay,
                f = t._id;
            S(L[f], n, r, i), s("eventDrop", e, t, n, r, i, function () {
                S(L[f], -n, -r, a), k(f)
            }, o, u), k(f)
        }

        function E(e, t, n, r, i, o) {
            var u = t._id;
            x(L[u], n, r), s("eventResize", e, t, n, r, function () {
                x(L[u], -n, -r), k(u)
            }, i, o), k(u)
        }

        function S(e, n, r, i) {
            r = r || 0;
            for (var s, o = e.length, u = 0; u < o; u++) s = e[u], i !== t && (s.allDay = i), l(a(s.start, n, !0), r), s.end && (s.end = l(a(s.end, n, !0), r)), C(s, M)
        }

        function x(e, t, n) {
            n = n || 0;
            for (var r, i = e.length, s = 0; s < i; s++) r = e[s], r.end = l(a(p(r), t, !0), n), C(r, M)
        }
        var T = this;
        T.element = e, T.calendar = n, T.name = r, T.opt = i, T.trigger = s, T.isEventDraggable = o, T.isEventResizable = u, T.reportEvents = c, T.eventEnd = p, T.reportEventElement = d, T.reportEventClear = v, T.eventElementHandlers = m, T.showEvents = g, T.hideEvents = y, T.eventDrop = w, T.eventResize = E;
        var N = T.defaultEventEnd,
            C = n.normalizeEvent,
            k = n.reportEventChange,
            L = {}, A = [],
            O = {}, M = n.options
    }

    function lt() {
        function n(e, t) {
            var n = I(),
                r = k(),
                a = A(),
                h = 0,
                m, g, y = e.length,
                b, w;
            n[0].innerHTML = i(e), s(e, n.children()), o(e), u(e, n, t), f(e), l(e), c(e), t = p();
            for (n = 0; n < r; n++) {
                m = [];
                for (g = 0; g < a; g++) m[g] = 0;
                for (; h < y && (b = e[h]).row == n;) {
                    g = U(m.slice(b.startCol, b.endCol)), b.top = g, g += b.outerHeight;
                    for (w = b.startCol; w < b.endCol; w++) m[w] = g;
                    h++
                }
                t[n].height(U(m))
            }
            v(e, d(t))
        }

        function r(t, n, r) {
            var o = e("<div/>"),
                u = I(),
                a = t.length,
                h;
            o[0].innerHTML = i(t), o = o.children(), u.append(o), s(t, o), f(t), l(t), c(t), v(t, d(p())), o = [];
            for (u = 0; u < a; u++)
                if (h = t[u].element) t[u].row === n && h.css("top", r), o.push(h[0]);
            return e(o)
        }

        function i(e) {
            var t = y("isRTL"),
                n, r = e.length,
                i, s, o, u;
            n = _();
            var a = n.left,
                f = n.right,
                l, c, h, p, d, v = "";
            for (n = 0; n < r; n++) i = e[n], s = i.event, u = ["fc-event", "fc-event-skin", "fc-event-hori"], w(s) && u.push("fc-event-draggable"), t ? (i.isStart && u.push("fc-corner-right"), i.isEnd && u.push("fc-corner-left"), l = H(i.end.getDay() - 1), c = H(i.start.getDay()), h = i.isEnd ? D(l) : a, p = i.isStart ? P(c) : f) : (i.isStart && u.push("fc-corner-left"), i.isEnd && u.push("fc-corner-right"), l = H(i.start.getDay()), c = H(i.end.getDay() - 1), h = i.isStart ? D(l) : a, p = i.isEnd ? P(c) : f), u = u.concat(s.className), s.source && (u = u.concat(s.source.className || [])), o = s.url, d = Q(s, y), v += o ? "<a href='" + X(o) + "'" : "<div", v += " class='" + u.join(" ") + "' style='position:absolute;z-index:8;left:" + h + "px;" + d + "'><div class='fc-event-inner fc-event-skin'" + (d ? " style='" + d + "'" : "") + ">", !s.allDay && i.isStart && (v += "<span class='fc-event-time'>" + X(R(s.start, s.end, y("timeFormat"))) + "</span>"), v += "<span class='fc-event-title'>" + X(s.title) + "</span></div>", i.isEnd && E(s) && (v += "<div class='ui-resizable-handle ui-resizable-" + (t ? "w" : "e") + "'>&nbsp;&nbsp;&nbsp;</div>"), v += "</" + (o ? "a" : "div") + ">", i.left = h, i.outerWidth = p - h, i.startCol = l, i.endCol = c + 1;
            return v
        }

        function s(t, n) {
            var r, i = t.length,
                s, o, u;
            for (r = 0; r < i; r++) s = t[r], o = s.event, u = e(n[r]), o = b("eventRender", o, o, u), o === !1 ? u.remove() : (o && o !== !0 && (o = e(o).css({
                position: "absolute",
                left: s.left
            }), u.replaceWith(o), u = o), s.element = u)
        }

        function o(e) {
            var t, n = e.length,
                r, i;
            for (t = 0; t < n; t++) r = e[t], (i = r.element) && x(r.event, i)
        }

        function u(e, t, n) {
            var r, i = e.length,
                s, o, u;
            for (r = 0; r < i; r++) {
                s = e[r];
                if (o = s.element) u = s.event, u._id === n ? q(u, o, s) : o[0]._fci = r
            }
            L(t, e, q)
        }

        function f(e) {
            var n, r = e.length,
                i, s, o, u, a = {};
            for (n = 0; n < r; n++) {
                i = e[n];
                if (s = i.element) o = i.key = V(s[0]), u = a[o], u === t && (u = a[o] = M(s, !0)), i.hsides = u
            }
        }

        function l(e) {
            var t, n = e.length,
                r, i;
            for (t = 0; t < n; t++) {
                r = e[t];
                if (i = r.element) i[0].style.width = Math.max(0, r.outerWidth - r.hsides) + "px"
            }
        }

        function c(e) {
            var n, r = e.length,
                i, s, o, u, a = {};
            for (n = 0; n < r; n++) {
                i = e[n];
                if (s = i.element) o = i.key, u = a[o], u === t && (u = a[o] = j(s)), i.outerHeight = s[0].offsetHeight + u
            }
        }

        function p() {
            var e, t = k(),
                n = [];
            for (e = 0; e < t; e++) n[e] = O(e).find("td:first div.fc-day-content > div");
            return n
        }

        function d(e) {
            var t, n = e.length,
                r = [];
            for (t = 0; t < n; t++) r[t] = e[t][0].offsetTop;
            return r
        }

        function v(e, t) {
            var n, r = e.length,
                i, s;
            for (n = 0; n < r; n++) {
                i = e[n];
                if (s = i.element) s[0].style.top = t[i.row] + (i.top || 0) + "px", i = i.event, b("eventAfterRender", i, i, s)
            }
        }

        function m(t, n, i) {
            var s = y("isRTL"),
                o = s ? "w" : "e",
                u = n.find("div.ui-resizable-" + o),
                f = !1;
            $(n), n.mousedown(function (e) {
                e.preventDefault()
            }).click(function (e) {
                f && (e.preventDefault(), e.stopImmediatePropagation())
            }), u.mousedown(function (u) {
                function l(n) {
                    b("eventResizeStop", this, t, n), e("body").css("cursor", ""), c.stop(), W(), w && C(this, t, w, 0, n), setTimeout(function () {
                        f = !1
                    }, 0)
                }
                if (u.which == 1) {
                    f = !0;
                    var c = g.getHoverListener(),
                        p = k(),
                        d = A(),
                        v = s ? -1 : 1,
                        m = s ? d - 1 : 0,
                        y = n.css("top"),
                        w, E, x = e.extend({}, t),
                        L = B(t.start);
                    J(), e("body").css("cursor", o + "-resize").one("mouseup", l), b("eventResizeStart", this, t, u), c.start(function (e, n) {
                        if (e) {
                            var u = Math.max(L.row, e.row);
                            e = e.col, p == 1 && (u = 0), u == L.row && (e = s ? Math.min(L.col, e) : Math.max(L.col, e)), w = u * 7 + e * v + m - (n.row * 7 + n.col * v + m), n = a(S(t), w, !0), w ? (x.end = n, u = E, E = r(F([x]), i.row, y), E.find("*").css("cursor", o + "-resize"), u && u.remove(), N(t)) : E && (T(t), E.remove(), E = null), W(), z(t.start, a(h(n), 1))
                        }
                    }, u)
                }
            })
        }
        var g = this;
        g.renderDaySegs = n, g.resizableDayEvent = m;
        var y = g.opt,
            b = g.trigger,
            w = g.isEventDraggable,
            E = g.isEventResizable,
            S = g.eventEnd,
            x = g.reportEventElement,
            T = g.showEvents,
            N = g.hideEvents,
            C = g.eventResize,
            k = g.getRowCnt,
            A = g.getColCnt,
            O = g.allDayRow,
            _ = g.allDayBounds,
            D = g.colContentLeft,
            P = g.colContentRight,
            H = g.dayOfWeekCol,
            B = g.dateCell,
            F = g.compileDaySegs,
            I = g.getDaySegmentContainer,
            q = g.bindDaySeg,
            R = g.calendar.formatDates,
            z = g.renderDayOverlay,
            W = g.clearOverlays,
            J = g.clearSelection
    }

    function ct() {
        function t(e, t, i) {
            n(), t || (t = a(e, i)), f(e, t, i), r(e, t, i)
        }

        function n(e) {
            c && (c = !1, l(), u("unselect", null, e))
        }

        function r(e, t, n, r) {
            c = !0, u("select", null, e, t, n, r)
        }

        function i(t) {
            var i = s.cellDate,
                u = s.cellIsAllDay,
                a = s.getHoverListener(),
                c = s.reportDayClick;
            if (t.which == 1 && o("selectable")) {
                n(t);
                var h;
                a.start(function (e, t) {
                    l(), e && u(e) ? (h = [i(t), i(e)].sort(R), f(h[0], h[1], !0)) : h = null
                }, t), e(document).one("mouseup", function (e) {
                    a.stop(), h && (+h[0] == +h[1] && c(h[0], !0, e), r(h[0], h[1], !0, e))
                })
            }
        }
        var s = this;
        s.select = t, s.unselect = n, s.reportSelection = r, s.daySelectionMousedown = i;
        var o = s.opt,
            u = s.trigger,
            a = s.defaultSelectionEnd,
            f = s.renderSelection,
            l = s.clearSelection,
            c = !1;
        o("selectable") && o("unselectAuto") && e(document).mousedown(function (t) {
            var r = o("unselectCancel");
            if (r && e(t.target).parents(r).length) return;
            n(t)
        })
    }

    function ht() {
        function t(t, n) {
            var r = s.shift();
            return r || (r = e("<div class='fc-cell-overlay' style='position:absolute;z-index:3'/>")), r[0].parentNode != n[0] && r.appendTo(n), i.push(r.css(t).show()), r
        }

        function n() {
            for (var e; e = i.shift();) s.push(e.hide().unbind())
        }
        var r = this;
        r.renderOverlay = t, r.clearOverlays = n;
        var i = [],
            s = []
    }

    function pt(e) {
        var t = this,
            n, r;
        t.build = function () {
            n = [], r = [], e(n, r)
        }, t.cell = function (e, t) {
            var i = n.length,
                s = r.length,
                o, u = -1,
                a = -1;
            for (o = 0; o < i; o++)
                if (t >= n[o][0] && t < n[o][1]) {
                    u = o;
                    break
                }
            for (o = 0; o < s; o++)
                if (e >= r[o][0] && e < r[o][1]) {
                    a = o;
                    break
                }
            return u >= 0 && a >= 0 ? {
                row: u,
                col: a
            } : null
        }, t.rect = function (e, t, i, s, o) {
            return o = o.offset(), {
                top: n[e][0] - o.top,
                left: r[t][0] - o.left,
                width: r[s][1] - r[t][0],
                height: n[i][1] - n[e][0]
            }
        }
    }

    function dt(t) {
        function n(e) {
            vt(e), e = t.cell(e.pageX, e.pageY);
            if (!e != !u || e && (e.row != u.row || e.col != u.col)) e ? (o || (o = e), s(e, o, e.row - o.row, e.col - o.col)) : s(e, o), u = e
        }
        var r = this,
            i, s, o, u;
        r.start = function (r, a, f) {
            s = r, o = u = null, t.build(), n(a), i = f || "mousemove", e(document).bind(i, n)
        }, r.stop = function () {
            return e(document).unbind(i, n), u
        }
    }

    function vt(e) {
        e.pageX === t && (e.pageX = e.originalEvent.pageX, e.pageY = e.originalEvent.pageY)
    }

    function mt(e) {
        function n(t) {
            return i[t] = i[t] || e(t)
        }
        var r = this,
            i = {}, s = {}, o = {};
        r.left = function (e) {
            return s[e] = s[e] === t ? n(e).position().left : s[e]
        }, r.right = function (e) {
            return o[e] = o[e] === t ? r.left(e) + n(e).width() : o[e]
        }, r.clear = function () {
            i = {}, s = {}, o = {}
        }
    }
    var gt = {
        defaultView: "month",
        aspectRatio: 1.35,
        header: {
            left: "title",
            center: "",
            right: "today prev,next"
        },
        weekends: !0,
        allDayDefault: !0,
        ignoreTimezone: !0,
        lazyFetching: !0,
        startParam: "start",
        endParam: "end",
        titleFormat: {
            month: "MMMM yyyy",
            week: "MMM d[ yyyy]{ '&#8212;'[ MMM] d yyyy}",
            day: "dddd, MMM d, yyyy"
        },
        columnFormat: {
            month: "ddd",
            week: "ddd M/d",
            day: "dddd M/d"
        },
        timeFormat: {
            "": "h(:mm)t"
        },
        isRTL: !1,
        firstDay: 0,
        monthNames: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],
        monthNamesShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
        dayNames: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
        dayNamesShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
        buttonText: {
            prev: "&nbsp;&#9668;&nbsp;",
            next: "&nbsp;&#9658;&nbsp;",
            prevYear: "&nbsp;&lt;&lt;&nbsp;",
            nextYear: "&nbsp;&gt;&gt;&nbsp;",
            today: "today",
            month: "month",
            week: "week",
            day: "day"
        },
        theme: !1,
        buttonIcons: {
            prev: "circle-triangle-w",
            next: "circle-triangle-e"
        },
        unselectAuto: !0,
        dropAccept: "*"
    }, yt = {
            header: {
                left: "next,prev today",
                center: "",
                right: "title"
            },
            buttonText: {
                prev: "&nbsp;&#9658;&nbsp;",
                next: "&nbsp;&#9668;&nbsp;",
                prevYear: "&nbsp;&gt;&gt;&nbsp;",
                nextYear: "&nbsp;&lt;&lt;&nbsp;"
            },
            buttonIcons: {
                prev: "circle-triangle-e",
                next: "circle-triangle-w"
            }
        }, bt = e.fullCalendar = {
            version: "1.5.4"
        }, wt = bt.views = {};
    e.fn.fullCalendar = function (n) {
        if (typeof n == "string") {
            var i = Array.prototype.slice.call(arguments, 1),
                s;
            return this.each(function () {
                var r = e.data(this, "fullCalendar");
                r && e.isFunction(r[n]) && (r = r[n].apply(r, i), s === t && (s = r), n == "destroy" && e.removeData(this, "fullCalendar"))
            }), s !== t ? s : this
        }
        var o = n.eventSources || [];
        return delete n.eventSources, n.events && (o.push(n.events), delete n.events), n = e.extend(!0, {}, gt, n.isRTL || n.isRTL === t && gt.isRTL ? yt : {}, n), this.each(function (t, i) {
            t = e(i), i = new r(t, n, o), t.data("fullCalendar", i), i.render()
        }), this
    }, bt.sourceNormalizers = [], bt.sourceFetchers = [];
    var Et = {
        dataType: "json",
        cache: !1
    }, St = 1;
    bt.addDays = a, bt.cloneDate = h, bt.parseDate = g, bt.parseISO8601 = y, bt.parseTime = b, bt.formatDate = w, bt.formatDates = E;
    var xt = ["sun", "mon", "tue", "wed", "thu", "fri", "sat"],
        Tt = 864e5,
        Nt = 36e5,
        Ct = 6e4,
        kt = {
            s: function (e) {
                return e.getSeconds()
            },
            ss: function (e) {
                return z(e.getSeconds())
            },
            m: function (e) {
                return e.getMinutes()
            },
            mm: function (e) {
                return z(e.getMinutes())
            },
            h: function (e) {
                return e.getHours() % 12 || 12
            },
            hh: function (e) {
                return z(e.getHours() % 12 || 12)
            },
            H: function (e) {
                return e.getHours()
            },
            HH: function (e) {
                return z(e.getHours())
            },
            d: function (e) {
                return e.getDate()
            },
            dd: function (e) {
                return z(e.getDate())
            },
            ddd: function (e, t) {
                return t.dayNamesShort[e.getDay()]
            },
            dddd: function (e, t) {
                return t.dayNames[e.getDay()]
            },
            M: function (e) {
                return e.getMonth() + 1
            },
            MM: function (e) {
                return z(e.getMonth() + 1)
            },
            MMM: function (e, t) {
                return t.monthNamesShort[e.getMonth()]
            },
            MMMM: function (e, t) {
                return t.monthNames[e.getMonth()]
            },
            yy: function (e) {
                return (e.getFullYear() + "").substring(2)
            },
            yyyy: function (e) {
                return e.getFullYear()
            },
            t: function (e) {
                return e.getHours() < 12 ? "a" : "p"
            },
            tt: function (e) {
                return e.getHours() < 12 ? "am" : "pm"
            },
            T: function (e) {
                return e.getHours() < 12 ? "A" : "P"
            },
            TT: function (e) {
                return e.getHours() < 12 ? "AM" : "PM"
            },
            u: function (e) {
                return w(e, "yyyy-MM-dd'T'HH:mm:ss'Z'")
            },
            S: function (e) {
                return e = e.getDate(), e > 10 && e < 20 ? "th" : ["st", "nd", "rd"][e % 10 - 1] || "th"
            }
        };
    bt.applyAll = G, wt.month = Z, wt.basicWeek = et, wt.basicDay = tt, n({
        weekMode: "fixed"
    }), wt.agendaWeek = it, wt.agendaDay = st, n({
        allDaySlot: !0,
        allDayText: "all-day",
        firstHour: 6,
        slotMinutes: 30,
        defaultEventMinutes: 120,
        axisFormat: "h(:mm)tt",
        timeFormat: {
            agenda: "h:mm{ - h:mm}"
        },
        dragOpacity: {
            agenda: .5
        },
        minTime: 0,
        maxTime: 24
    })
}(jQuery),
function (e) {
    e.gritter = {}, e.gritter.options = {
        position: "",
        class_name: "",
        fade_in_speed: "medium",
        fade_out_speed: 1e3,
        time: 6e3
    }, e.gritter.add = function (e) {
        try {
            return t.add(e || {})
        } catch (n) {
            var r = "Gritter Error: " + n;
            typeof console != "undefined" && console.error ? console.error(r, e) : alert(r)
        }
    }, e.gritter.remove = function (e, n) {
        t.removeSpecific(e, n || {})
    }, e.gritter.removeAll = function (e) {
        t.stop(e || {})
    };
    var t = {
        position: "",
        fade_in_speed: "",
        fade_out_speed: "",
        time: "",
        _custom_timer: 0,
        _item_count: 0,
        _is_setup: 0,
        _tpl_close: '<div class="gritter-close"></div>',
        _tpl_title: '<span class="gritter-title">[[title]]</span>',
        _tpl_item: '<div id="gritter-item-[[number]]" class="gritter-item-wrapper [[item_class]]" style="display:none"><div class="gritter-item">[[close]][[image]]<div class="[[class_name]]">[[title]]<p>[[text]]</p></div><div style="clear:both"></div></div></div>',
        _tpl_wrap: '<div id="gritter-notice-wrapper"></div>',
        add: function (n) {
            typeof n == "string" && (n = {
                text: n
            });
            if (!n.text) throw 'You must supply "text" parameter.';
            this._is_setup || this._runSetup();
            var r = n.title,
                i = n.text,
                s = n.image || "",
                o = n.sticky || !1,
                u = n.class_name || e.gritter.options.class_name,
                a = e.gritter.options.position,
                f = n.time || "";
            this._verifyWrapper(), this._item_count++;
            var l = this._item_count,
                c = this._tpl_item;
            e(["before_open", "after_open", "before_close", "after_close"]).each(function (r, i) {
                t["_" + i + "_" + l] = e.isFunction(n[i]) ? n[i] : function () {}
            }), this._custom_timer = 0, f && (this._custom_timer = f);
            var h = s != "" ? '<img src="' + s + '" class="gritter-image" />' : "",
                p = s != "" ? "gritter-with-image" : "gritter-without-image";
            r ? r = this._str_replace("[[title]]", r, this._tpl_title) : r = "", c = this._str_replace(["[[title]]", "[[text]]", "[[close]]", "[[image]]", "[[number]]", "[[class_name]]", "[[item_class]]"], [r, i, this._tpl_close, h, this._item_count, p, u], c);
            if (this["_before_open_" + l]() === !1) return !1;
            e("#gritter-notice-wrapper").addClass(a).append(c);
            var d = e("#gritter-item-" + this._item_count);
            return d.fadeIn(this.fade_in_speed, function () {
                t["_after_open_" + l](e(this))
            }), o || this._setFadeTimer(d, l), e(d).bind("mouseenter mouseleave", function (n) {
                n.type == "mouseenter" ? o || t._restoreItemIfFading(e(this), l) : o || t._setFadeTimer(e(this), l), t._hoverState(e(this), n.type)
            }), e(d).find(".gritter-close").click(function () {
                t.removeSpecific(l, {}, null, !0)
            }), l
        },
        _countRemoveWrapper: function (t, n, r) {
            n.remove(), this["_after_close_" + t](n, r), e(".gritter-item-wrapper").length == 0 && e("#gritter-notice-wrapper").remove()
        },
        _fade: function (e, n, r, i) {
            var r = r || {}, s = typeof r.fade != "undefined" ? r.fade : !0,
                o = r.speed || this.fade_out_speed,
                u = i;
            this["_before_close_" + n](e, u), i && e.unbind("mouseenter mouseleave"), s ? e.animate({
                opacity: 0
            }, o, function () {
                e.animate({
                    height: 0
                }, 300, function () {
                    t._countRemoveWrapper(n, e, u)
                })
            }) : this._countRemoveWrapper(n, e)
        },
        _hoverState: function (e, t) {
            t == "mouseenter" ? (e.addClass("hover"), e.find(".gritter-close").show()) : (e.removeClass("hover"), e.find(".gritter-close").hide())
        },
        removeSpecific: function (t, n, r, i) {
            if (!r) var r = e("#gritter-item-" + t);
            this._fade(r, t, n || {}, i)
        },
        _restoreItemIfFading: function (e, t) {
            clearTimeout(this["_int_id_" + t]), e.stop().css({
                opacity: "",
                height: ""
            })
        },
        _runSetup: function () {
            for (opt in e.gritter.options) this[opt] = e.gritter.options[opt];
            this._is_setup = 1
        },
        _setFadeTimer: function (e, n) {
            var r = this._custom_timer ? this._custom_timer : this.time;
            this["_int_id_" + n] = setTimeout(function () {
                t._fade(e, n)
            }, r)
        },
        stop: function (t) {
            var n = e.isFunction(t.before_close) ? t.before_close : function () {}, r = e.isFunction(t.after_close) ? t.after_close : function () {}, i = e("#gritter-notice-wrapper");
            n(i), i.fadeOut(function () {
                e(this).remove(), r()
            })
        },
        _str_replace: function (e, t, n, r) {
            var i = 0,
                s = 0,
                o = "",
                u = "",
                a = 0,
                f = 0,
                l = [].concat(e),
                c = [].concat(t),
                h = n,
                p = c instanceof Array,
                d = h instanceof Array;
            h = [].concat(h), r && (this.window[r] = 0);
            for (i = 0, a = h.length; i < a; i++) {
                if (h[i] === "") continue;
                for (s = 0, f = l.length; s < f; s++) o = h[i] + "", u = p ? c[s] !== undefined ? c[s] : "" : c[0], h[i] = o.split(l[s]).join(u), r && h[i] !== o && (this.window[r] += (o.length - h[i].length) / l[s].length)
            }
            return d ? h : h[0]
        },
        _verifyWrapper: function () {
            e("#gritter-notice-wrapper").length == 0 && e("body").append(this._tpl_wrap)
        }
    }
}(jQuery),
function (e) {
    typeof define == "function" && define.amd ? define(["jquery"], e) : e(jQuery)
}(function (e) {
    "use strict";
    var t = {}, n, r, i, s, o, u, a, f, l, c, h, p, d, v, m, g, y, b, w, E, S, x, T, N, C, k, L, A, O, M, _, D, P = 0;
    n = function () {
        return {
            common: {
                type: "line",
                lineColor: "#00f",
                fillColor: "#cdf",
                defaultPixelsPerValue: 3,
                width: "auto",
                height: "auto",
                composite: !1,
                tagValuesAttribute: "values",
                tagOptionsPrefix: "spark",
                enableTagOptions: !1,
                enableHighlight: !0,
                highlightLighten: 1.4,
                tooltipSkipNull: !0,
                tooltipPrefix: "",
                tooltipSuffix: "",
                disableHiddenCheck: !1,
                numberFormatter: !1,
                numberDigitGroupCount: 3,
                numberDigitGroupSep: ",",
                numberDecimalMark: ".",
                disableTooltips: !1,
                disableInteraction: !1
            },
            line: {
                spotColor: "#f80",
                highlightSpotColor: "#5f5",
                highlightLineColor: "#f22",
                spotRadius: 1.5,
                minSpotColor: "#f80",
                maxSpotColor: "#f80",
                lineWidth: 1,
                normalRangeMin: undefined,
                normalRangeMax: undefined,
                normalRangeColor: "#ccc",
                drawNormalOnTop: !1,
                chartRangeMin: undefined,
                chartRangeMax: undefined,
                chartRangeMinX: undefined,
                chartRangeMaxX: undefined,
                tooltipFormat: new i('<span style="color: {{color}}">&#9679;</span> {{prefix}}{{y}}{{suffix}}')
            },
            bar: {
                barColor: "#3366cc",
                negBarColor: "#f44",
                stackedBarColor: ["#3366cc", "#dc3912", "#ff9900", "#109618", "#66aa00", "#dd4477", "#0099c6", "#990099"],
                zeroColor: undefined,
                nullColor: undefined,
                zeroAxis: !0,
                barWidth: 4,
                barSpacing: 1,
                chartRangeMax: undefined,
                chartRangeMin: undefined,
                chartRangeClip: !1,
                colorMap: undefined,
                tooltipFormat: new i('<span style="color: {{color}}">&#9679;</span> {{prefix}}{{value}}{{suffix}}')
            },
            tristate: {
                barWidth: 4,
                barSpacing: 1,
                posBarColor: "#6f6",
                negBarColor: "#f44",
                zeroBarColor: "#999",
                colorMap: {},
                tooltipFormat: new i('<span style="color: {{color}}">&#9679;</span> {{value:map}}'),
                tooltipValueLookups: {
                    map: {
                        "-1": "Loss",
                        0: "Draw",
                        1: "Win"
                    }
                }
            },
            discrete: {
                lineHeight: "auto",
                thresholdColor: undefined,
                thresholdValue: 0,
                chartRangeMax: undefined,
                chartRangeMin: undefined,
                chartRangeClip: !1,
                tooltipFormat: new i("{{prefix}}{{value}}{{suffix}}")
            },
            bullet: {
                targetColor: "#f33",
                targetWidth: 3,
                performanceColor: "#33f",
                rangeColors: ["#d3dafe", "#a8b6ff", "#7f94ff"],
                base: undefined,
                tooltipFormat: new i("{{fieldkey:fields}} - {{value}}"),
                tooltipValueLookups: {
                    fields: {
                        r: "Range",
                        p: "Performance",
                        t: "Target"
                    }
                }
            },
            pie: {
                offset: 0,
                sliceColors: ["#3366cc", "#dc3912", "#ff9900", "#109618", "#66aa00", "#dd4477", "#0099c6", "#990099"],
                borderWidth: 0,
                borderColor: "#000",
                tooltipFormat: new i('<span style="color: {{color}}">&#9679;</span> {{value}} ({{percent.1}}%)')
            },
            box: {
                raw: !1,
                boxLineColor: "#000",
                boxFillColor: "#cdf",
                whiskerColor: "#000",
                outlierLineColor: "#333",
                outlierFillColor: "#fff",
                medianColor: "#f00",
                showOutliers: !0,
                outlierIQR: 1.5,
                spotRadius: 1.5,
                target: undefined,
                targetColor: "#4a2",
                chartRangeMax: undefined,
                chartRangeMin: undefined,
                tooltipFormat: new i("{{field:fields}}: {{value}}"),
                tooltipFormatFieldlistKey: "field",
                tooltipValueLookups: {
                    fields: {
                        lq: "Lower Quartile",
                        med: "Median",
                        uq: "Upper Quartile",
                        lo: "Left Outlier",
                        ro: "Right Outlier",
                        lw: "Left Whisker",
                        rw: "Right Whisker"
                    }
                }
            }
        }
    }, k = '.jqstooltip { position: absolute;left: 0px;top: 0px;visibility: hidden;background: rgb(0, 0, 0) transparent;background-color: rgba(0,0,0,0.6);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#99000000, endColorstr=#99000000);-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#99000000, endColorstr=#99000000)";color: white;font: 10px arial, san serif;text-align: left;white-space: nowrap;padding: 5px;border: 1px solid white;z-index: 10000;}.jqsfield { color: white;font: 10px arial, san serif;text-align: left;}', r = function () {
        var t, n;
        return t = function () {
            this.init.apply(this, arguments)
        }, arguments.length > 1 ? (arguments[0] ? (t.prototype = e.extend(new arguments[0], arguments[arguments.length - 1]), t._super = arguments[0].prototype) : t.prototype = arguments[arguments.length - 1], arguments.length > 2 && (n = Array.prototype.slice.call(arguments, 1, -1), n.unshift(t.prototype), e.extend.apply(e, n))) : t.prototype = arguments[0], t.prototype.cls = t, t
    }, e.SPFormatClass = i = r({
        fre: /\{\{([\w.]+?)(:(.+?))?\}\}/g,
        precre: /(\w+)\.(\d+)/,
        init: function (e, t) {
            this.format = e, this.fclass = t
        },
        render: function (e, t, n) {
            var r = this,
                i = e,
                s, o, u, a, f;
            return this.format.replace(this.fre, function () {
                var e;
                return o = arguments[1], u = arguments[3], s = r.precre.exec(o), s ? (f = s[2], o = s[1]) : f = !1, a = i[o], a === undefined ? "" : u && t && t[u] ? (e = t[u], e.get ? t[u].get(a) || a : t[u][a] || a) : (l(a) && (n.get("numberFormatter") ? a = n.get("numberFormatter")(a) : a = v(a, f, n.get("numberDigitGroupCount"), n.get("numberDigitGroupSep"), n.get("numberDecimalMark"))), a)
            })
        }
    }), e.spformat = function (e, t) {
        return new i(e, t)
    }, s = function (e, t, n) {
        return e < t ? t : e > n ? n : e
    }, o = function (e, t) {
        var n;
        return t === 2 ? (n = Math.floor(e.length / 2), e.length % 2 ? e[n] : (e[n - 1] + e[n]) / 2) : e.length % 2 ? (n = (e.length * t + t) / 4, n % 1 ? (e[Math.floor(n)] + e[Math.floor(n) - 1]) / 2 : e[n - 1]) : (n = (e.length * t + 2) / 4, n % 1 ? (e[Math.floor(n)] + e[Math.floor(n) - 1]) / 2 : e[n - 1])
    }, u = function (e) {
        var t;
        switch (e) {
        case "undefined":
            e = undefined;
            break;
        case "null":
            e = null;
            break;
        case "true":
            e = !0;
            break;
        case "false":
            e = !1;
            break;
        default:
            t = parseFloat(e), e == t && (e = t)
        }
        return e
    }, a = function (e) {
        var t, n = [];
        for (t = e.length; t--;) n[t] = u(e[t]);
        return n
    }, f = function (e, t) {
        var n, r, i = [];
        for (n = 0, r = e.length; n < r; n++) e[n] !== t && i.push(e[n]);
        return i
    }, l = function (e) {
        return !isNaN(parseFloat(e)) && isFinite(e)
    }, v = function (t, n, r, i, s) {
        var o, u;
        t = (n === !1 ? parseFloat(t).toString() : t.toFixed(n)).split(""), o = (o = e.inArray(".", t)) < 0 ? t.length : o, o < t.length && (t[o] = s);
        for (u = o - r; u > 0; u -= r) t.splice(u, 0, i);
        return t.join("")
    }, c = function (e, t, n) {
        var r;
        for (r = t.length; r--;) {
            if (n && t[r] === null) continue;
            if (t[r] !== e) return !1
        }
        return !0
    }, h = function (e) {
        var t = 0,
            n;
        for (n = e.length; n--;) t += typeof e[n] == "number" ? e[n] : 0;
        return t
    }, d = function (t) {
        return e.isArray(t) ? t : [t]
    }, p = function (e) {
        var t;
        document.createStyleSheet ? document.createStyleSheet().cssText = e : (t = document.createElement("style"), t.type = "text/css", document.getElementsByTagName("head")[0].appendChild(t), t[typeof document.body.style.WebkitAppearance == "string" ? "innerText" : "innerHTML"] = e)
    }, e.fn.simpledraw = function (t, n, r, i) {
        var s, o;
        if (r && (s = this.data("_jqs_vcanvas"))) return s;
        t === undefined && (t = e(this).innerWidth()), n === undefined && (n = e(this).innerHeight());
        if (e.fn.sparkline.hasCanvas) s = new M(t, n, this, i);
        else {
            if (!e.fn.sparkline.hasVML) return !1;
            s = new _(t, n, this)
        }
        return o = e(this).data("_jqs_mhandler"), o && o.registerCanvas(s), s
    }, e.fn.cleardraw = function () {
        var e = this.data("_jqs_vcanvas");
        e && e.reset()
    }, e.RangeMapClass = m = r({
        init: function (e) {
            var t, n, r = [];
            for (t in e) e.hasOwnProperty(t) && typeof t == "string" && t.indexOf(":") > -1 && (n = t.split(":"), n[0] = n[0].length === 0 ? -Infinity : parseFloat(n[0]), n[1] = n[1].length === 0 ? Infinity : parseFloat(n[1]), n[2] = e[t], r.push(n));
            this.map = e, this.rangelist = r || !1
        },
        get: function (e) {
            var t = this.rangelist,
                n, r, i;
            if ((i = this.map[e]) !== undefined) return i;
            if (t)
                for (n = t.length; n--;) {
                    r = t[n];
                    if (r[0] <= e && r[1] >= e) return r[2]
                }
            return undefined
        }
    }), e.range_map = function (e) {
        return new m(e)
    }, g = r({
        init: function (t, n) {
            var r = e(t);
            this.$el = r, this.options = n, this.currentPageX = 0, this.currentPageY = 0, this.el = t, this.splist = [], this.tooltip = null, this.over = !1, this.displayTooltips = !n.get("disableTooltips"), this.highlightEnabled = !n.get("disableHighlight")
        },
        registerSparkline: function (e) {
            this.splist.push(e), this.over && this.updateDisplay()
        },
        registerCanvas: function (t) {
            var n = e(t.canvas);
            this.canvas = t, this.$canvas = n, n.mouseenter(e.proxy(this.mouseenter, this)), n.mouseleave(e.proxy(this.mouseleave, this)), n.click(e.proxy(this.mouseclick, this))
        },
        reset: function (e) {
            this.splist = [], this.tooltip && e && (this.tooltip.remove(), this.tooltip = undefined)
        },
        mouseclick: function (t) {
            var n = e.Event("sparklineClick");
            n.originalEvent = t, n.sparklines = this.splist, this.$el.trigger(n)
        },
        mouseenter: function (t) {
            e(document.body).unbind("mousemove.jqs"), e(document.body).bind("mousemove.jqs", e.proxy(this.mousemove, this)), this.over = !0, this.currentPageX = t.pageX, this.currentPageY = t.pageY, this.currentEl = t.target, !this.tooltip && this.displayTooltips && (this.tooltip = new y(this.options), this.tooltip.updatePosition(t.pageX, t.pageY)), this.updateDisplay()
        },
        mouseleave: function () {
            e(document.body).unbind("mousemove.jqs");
            var t = this.splist,
                n = t.length,
                r = !1,
                i, s;
            this.over = !1, this.currentEl = null, this.tooltip && (this.tooltip.remove(), this.tooltip = null);
            for (s = 0; s < n; s++) i = t[s], i.clearRegionHighlight() && (r = !0);
            r && this.canvas.render()
        },
        mousemove: function (e) {
            this.currentPageX = e.pageX, this.currentPageY = e.pageY, this.currentEl = e.target, this.tooltip && this.tooltip.updatePosition(e.pageX, e.pageY), this.updateDisplay()
        },
        updateDisplay: function () {
            var t = this.splist,
                n = t.length,
                r = !1,
                i = this.$canvas.offset(),
                s = this.currentPageX - i.left,
                o = this.currentPageY - i.top,
                u, a, f, l, c;
            if (!this.over) return;
            for (f = 0; f < n; f++) a = t[f], l = a.setRegionHighlight(this.currentEl, s, o), l && (r = !0);
            if (r) {
                c = e.Event("sparklineRegionChange"), c.sparklines = this.splist, this.$el.trigger(c);
                if (this.tooltip) {
                    u = "";
                    for (f = 0; f < n; f++) a = t[f], u += a.getCurrentRegionTooltip();
                    this.tooltip.setContent(u)
                }
                this.disableHighlight || this.canvas.render()
            }
            l === null && this.mouseleave()
        }
    }), y = r({
        sizeStyle: "position: static !important;display: block !important;visibility: hidden !important;float: left !important;",
        init: function (t) {
            var n = t.get("tooltipClassname", "jqstooltip"),
                r = this.sizeStyle,
                i;
            this.container = t.get("tooltipContainer") || document.body, this.tooltipOffsetX = t.get("tooltipOffsetX", 10), this.tooltipOffsetY = t.get("tooltipOffsetY", 12), e("#jqssizetip").remove(), e("#jqstooltip").remove(), this.sizetip = e("<div/>", {
                id: "jqssizetip",
                style: r,
                "class": n
            }), this.tooltip = e("<div/>", {
                id: "jqstooltip",
                "class": n
            }).appendTo(this.container), i = this.tooltip.offset(), this.offsetLeft = i.left, this.offsetTop = i.top, this.hidden = !0, e(window).unbind("resize.jqs scroll.jqs"), e(window).bind("resize.jqs scroll.jqs", e.proxy(this.updateWindowDims, this)), this.updateWindowDims()
        },
        updateWindowDims: function () {
            this.scrollTop = e(window).scrollTop(), this.scrollLeft = e(window).scrollLeft(), this.scrollRight = this.scrollLeft + e(window).width(), this.updatePosition()
        },
        getSize: function (e) {
            this.sizetip.html(e).appendTo(this.container), this.width = this.sizetip.width() + 1, this.height = this.sizetip.height(), this.sizetip.remove()
        },
        setContent: function (e) {
            if (!e) {
                this.tooltip.css("visibility", "hidden"), this.hidden = !0;
                return
            }
            this.getSize(e), this.tooltip.html(e).css({
                width: this.width,
                height: this.height,
                visibility: "visible"
            }), this.hidden && (this.hidden = !1, this.updatePosition())
        },
        updatePosition: function (e, t) {
            if (e === undefined) {
                if (this.mousex === undefined) return;
                e = this.mousex - this.offsetLeft, t = this.mousey - this.offsetTop
            } else this.mousex = e -= this.offsetLeft, this.mousey = t -= this.offsetTop; if (!this.height || !this.width || this.hidden) return;
            t -= this.height + this.tooltipOffsetY, e += this.tooltipOffsetX, t < this.scrollTop && (t = this.scrollTop), e < this.scrollLeft ? e = this.scrollLeft : e + this.width > this.scrollRight && (e = this.scrollRight - this.width), this.tooltip.css({
                left: e,
                top: t
            })
        },
        remove: function () {
            this.tooltip.remove(), this.sizetip.remove(), this.sizetip = this.tooltip = undefined, e(window).unbind("resize.jqs scroll.jqs")
        }
    }), L = function () {
        p(k)
    }, e(L), D = [], e.fn.sparkline = function (t, n) {
        return this.each(function () {
            var r = new e.fn.sparkline.options(this, n),
                i = e(this),
                s, o;
            s = function () {
                var n, s, o, u, a, f, l;
                if (t === "html" || t === undefined) {
                    l = this.getAttribute(r.get("tagValuesAttribute"));
                    if (l === undefined || l === null) l = i.html();
                    n = l.replace(/(^\s*<!--)|(-->\s*$)|\s+/g, "").split(",")
                } else n = t;
                s = r.get("width") === "auto" ? n.length * r.get("defaultPixelsPerValue") : r.get("width");
                if (r.get("height") === "auto") {
                    if (!r.get("composite") || !e.data(this, "_jqs_vcanvas")) u = document.createElement("span"), u.innerHTML = "a", i.html(u), o = e(u).innerHeight() || e(u).height(), e(u).remove(), u = null
                } else o = r.get("height");
                r.get("disableInteraction") ? a = !1 : (a = e.data(this, "_jqs_mhandler"), a ? r.get("composite") || a.reset() : (a = new g(this, r), e.data(this, "_jqs_mhandler", a)));
                if (r.get("composite") && !e.data(this, "_jqs_vcanvas")) {
                    e.data(this, "_jqs_errnotify") || (alert("Attempted to attach a composite sparkline to an element with no existing sparkline"), e.data(this, "_jqs_errnotify", !0));
                    return
                }
                f = new(e.fn.sparkline[r.get("type")])(this, n, r, s, o), f.render(), a && a.registerSparkline(f)
            };
            if (e(this).html() && !r.get("disableHiddenCheck") && e(this).is(":hidden") || e.fn.jquery < "1.3.0" && e(this).parents().is(":hidden") || !e(this).parents("body").length) {
                if (!r.get("composite") && e.data(this, "_jqs_pending"))
                    for (o = D.length; o; o--) D[o - 1][0] == this && D.splice(o - 1, 1);
                D.push([this, s]), e.data(this, "_jqs_pending", !0)
            } else s.call(this)
        })
    }, e.fn.sparkline.defaults = n(), e.sparkline_display_visible = function () {
        var t, n, r, i = [];
        for (n = 0, r = D.length; n < r; n++) t = D[n][0], e(t).is(":visible") && !e(t).parents().is(":hidden") ? (D[n][1].call(t), e.data(D[n][0], "_jqs_pending", !1), i.push(n)) : !e(t).closest("html").length && !e.data(t, "_jqs_pending") && (e.data(D[n][0], "_jqs_pending", !1), i.push(n));
        for (n = i.length; n; n--) D.splice(i[n - 1], 1)
    }, e.fn.sparkline.options = r({
        init: function (n, r) {
            var i, s, o, u;
            this.userOptions = r = r || {}, this.tag = n, this.tagValCache = {}, s = e.fn.sparkline.defaults, o = s.common, this.tagOptionsPrefix = r.enableTagOptions && (r.tagOptionsPrefix || o.tagOptionsPrefix), u = this.getTagSetting("type"), u === t ? i = s[r.type || o.type] : i = s[u], this.mergedOptions = e.extend({}, o, i, r)
        },
        getTagSetting: function (e) {
            var n = this.tagOptionsPrefix,
                r, i, s, o;
            if (n === !1 || n === undefined) return t;
            if (this.tagValCache.hasOwnProperty(e)) r = this.tagValCache.key;
            else {
                r = this.tag.getAttribute(n + e);
                if (r === undefined || r === null) r = t;
                else if (r.substr(0, 1) === "[") {
                    r = r.substr(1, r.length - 2).split(",");
                    for (i = r.length; i--;) r[i] = u(r[i].replace(/(^\s*)|(\s*$)/g, ""))
                } else if (r.substr(0, 1) === "{") {
                    s = r.substr(1, r.length - 2).split(","), r = {};
                    for (i = s.length; i--;) o = s[i].split(":", 2), r[o[0].replace(/(^\s*)|(\s*$)/g, "")] = u(o[1].replace(/(^\s*)|(\s*$)/g, ""))
                } else r = u(r);
                this.tagValCache.key = r
            }
            return r
        },
        get: function (e, n) {
            var r = this.getTagSetting(e),
                i;
            return r !== t ? r : (i = this.mergedOptions[e]) === undefined ? n : i
        }
    }), e.fn.sparkline._base = r({
        disabled: !1,
        init: function (t, n, r, i, s) {
            this.el = t, this.$el = e(t), this.values = n, this.options = r, this.width = i, this.height = s, this.currentRegion = undefined
        },
        initTarget: function () {
            var e = !this.options.get("disableInteraction");
            (this.target = this.$el.simpledraw(this.width, this.height, this.options.get("composite"), e)) ? (this.canvasWidth = this.target.pixelWidth, this.canvasHeight = this.target.pixelHeight) : this.disabled = !0
        },
        render: function () {
            return this.disabled ? (this.el.innerHTML = "", !1) : !0
        },
        getRegion: function (e, t) {},
        setRegionHighlight: function (e, t, n) {
            var r = this.currentRegion,
                i = !this.options.get("disableHighlight"),
                s;
            return t > this.canvasWidth || n > this.canvasHeight || t < 0 || n < 0 ? null : (s = this.getRegion(e, t, n), r !== s ? (r !== undefined && i && this.removeHighlight(), this.currentRegion = s, s !== undefined && i && this.renderHighlight(), !0) : !1)
        },
        clearRegionHighlight: function () {
            return this.currentRegion !== undefined ? (this.removeHighlight(), this.currentRegion = undefined, !0) : !1
        },
        renderHighlight: function () {
            this.changeHighlight(!0)
        },
        removeHighlight: function () {
            this.changeHighlight(!1)
        },
        changeHighlight: function (e) {},
        getCurrentRegionTooltip: function () {
            var t = this.options,
                n = "",
                r = [],
                s, o, u, a, f, l, c, h, p, d, v, m, g, y;
            if (this.currentRegion === undefined) return "";
            s = this.getCurrentRegionFields(), v = t.get("tooltipFormatter");
            if (v) return v(this, t, s);
            t.get("tooltipChartTitle") && (n += '<div class="jqs jqstitle">' + t.get("tooltipChartTitle") + "</div>\n"), o = this.options.get("tooltipFormat");
            if (!o) return "";
            e.isArray(o) || (o = [o]), e.isArray(s) || (s = [s]), c = this.options.get("tooltipFormatFieldlist"), h = this.options.get("tooltipFormatFieldlistKey");
            if (c && h) {
                p = [];
                for (l = s.length; l--;) d = s[l][h], (y = e.inArray(d, c)) != -1 && (p[y] = s[l]);
                s = p
            }
            u = o.length, g = s.length;
            for (l = 0; l < u; l++) {
                m = o[l], typeof m == "string" && (m = new i(m)), a = m.fclass || "jqsfield";
                for (y = 0; y < g; y++)
                    if (!s[y].isNull || !t.get("tooltipSkipNull")) e.extend(s[y], {
                        prefix: t.get("tooltipPrefix"),
                        suffix: t.get("tooltipSuffix")
                    }), f = m.render(s[y], t.get("tooltipValueLookups"), t), r.push('<div class="' + a + '">' + f + "</div>")
            }
            return r.length ? n + r.join("\n") : ""
        },
        getCurrentRegionFields: function () {},
        calcHighlightColor: function (e, t) {
            var n = t.get("highlightColor"),
                r = t.get("highlightLighten"),
                i, o, u, a;
            if (n) return n;
            if (r) {
                i = /^#([0-9a-f])([0-9a-f])([0-9a-f])$/i.exec(e) || /^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i.exec(e);
                if (i) {
                    u = [], o = e.length === 4 ? 16 : 1;
                    for (a = 0; a < 3; a++) u[a] = s(Math.round(parseInt(i[a + 1], 16) * o * r), 0, 255);
                    return "rgb(" + u.join(",") + ")"
                }
            }
            return e
        }
    }), b = {
        changeHighlight: function (t) {
            var n = this.currentRegion,
                r = this.target,
                i = this.regionShapes[n],
                s;
            i && (s = this.renderRegion(n, t), e.isArray(s) || e.isArray(i) ? (r.replaceWithShapes(i, s), this.regionShapes[n] = e.map(s, function (e) {
                return e.id
            })) : (r.replaceWithShape(i, s), this.regionShapes[n] = s.id))
        },
        render: function () {
            var t = this.values,
                n = this.target,
                r = this.regionShapes,
                i, s, o, u;
            if (!this.cls._super.render.call(this)) return;
            for (o = t.length; o--;) {
                i = this.renderRegion(o);
                if (i)
                    if (e.isArray(i)) {
                        s = [];
                        for (u = i.length; u--;) i[u].append(), s.push(i[u].id);
                        r[o] = s
                    } else i.append(), r[o] = i.id;
                    else r[o] = null
            }
            n.render()
        }
    }, e.fn.sparkline.line = w = r(e.fn.sparkline._base, {
        type: "line",
        init: function (e, t, n, r, i) {
            w._super.init.call(this, e, t, n, r, i), this.vertices = [], this.regionMap = [], this.xvalues = [], this.yvalues = [], this.yminmax = [], this.hightlightSpotId = null, this.lastShapeId = null, this.initTarget()
        },
        getRegion: function (e, t, n) {
            var r, i = this.regionMap;
            for (r = i.length; r--;)
                if (i[r] !== null && t >= i[r][0] && t <= i[r][1]) return i[r][2];
            return undefined
        },
        getCurrentRegionFields: function () {
            var e = this.currentRegion;
            return {
                isNull: this.yvalues[e] === null,
                x: this.xvalues[e],
                y: this.yvalues[e],
                color: this.options.get("lineColor"),
                fillColor: this.options.get("fillColor"),
                offset: e
            }
        },
        renderHighlight: function () {
            var e = this.currentRegion,
                t = this.target,
                n = this.vertices[e],
                r = this.options,
                i = r.get("spotRadius"),
                s = r.get("highlightSpotColor"),
                o = r.get("highlightLineColor"),
                u, a;
            if (!n) return;
            i && s && (u = t.drawCircle(n[0], n[1], i, undefined, s), this.highlightSpotId = u.id, t.insertAfterShape(this.lastShapeId, u)), o && (a = t.drawLine(n[0], this.canvasTop, n[0], this.canvasTop + this.canvasHeight, o), this.highlightLineId = a.id, t.insertAfterShape(this.lastShapeId, a))
        },
        removeHighlight: function () {
            var e = this.target;
            this.highlightSpotId && (e.removeShapeId(this.highlightSpotId), this.highlightSpotId = null), this.highlightLineId && (e.removeShapeId(this.highlightLineId), this.highlightLineId = null)
        },
        scanValues: function () {
            var e = this.values,
                t = e.length,
                n = this.xvalues,
                r = this.yvalues,
                i = this.yminmax,
                s, o, u, a, f;
            for (s = 0; s < t; s++) o = e[s], u = typeof e[s] == "string", a = typeof e[s] == "object" && e[s] instanceof Array, f = u && e[s].split(":"), u && f.length === 2 ? (n.push(Number(f[0])), r.push(Number(f[1])), i.push(Number(f[1]))) : a ? (n.push(o[0]), r.push(o[1]), i.push(o[1])) : (n.push(s), e[s] === null || e[s] === "null" ? r.push(null) : (r.push(Number(o)), i.push(Number(o))));
            this.options.get("xvalues") && (n = this.options.get("xvalues")), this.maxy = this.maxyorg = Math.max.apply(Math, i), this.miny = this.minyorg = Math.min.apply(Math, i), this.maxx = Math.max.apply(Math, n), this.minx = Math.min.apply(Math, n), this.xvalues = n, this.yvalues = r, this.yminmax = i
        },
        processRangeOptions: function () {
            var e = this.options,
                t = e.get("normalRangeMin"),
                n = e.get("normalRangeMax");
            t !== undefined && (t < this.miny && (this.miny = t), n > this.maxy && (this.maxy = n)), e.get("chartRangeMin") !== undefined && (e.get("chartRangeClip") || e.get("chartRangeMin") < this.miny) && (this.miny = e.get("chartRangeMin")), e.get("chartRangeMax") !== undefined && (e.get("chartRangeClip") || e.get("chartRangeMax") > this.maxy) && (this.maxy = e.get("chartRangeMax")), e.get("chartRangeMinX") !== undefined && (e.get("chartRangeClipX") || e.get("chartRangeMinX") < this.minx) && (this.minx = e.get("chartRangeMinX")), e.get("chartRangeMaxX") !== undefined && (e.get("chartRangeClipX") || e.get("chartRangeMaxX") > this.maxx) && (this.maxx = e.get("chartRangeMaxX"))
        },
        drawNormalRange: function (e, t, n, r, i) {
            var s = this.options.get("normalRangeMin"),
                o = this.options.get("normalRangeMax"),
                u = t + Math.round(n - n * ((o - this.miny) / i)),
                a = Math.round(n * (o - s) / i);
            this.target.drawRect(e, u, r, a, undefined, this.options.get("normalRangeColor")).append()
        },
        render: function () {
            var t = this.options,
                n = this.target,
                r = this.canvasWidth,
                i = this.canvasHeight,
                s = this.vertices,
                o = t.get("spotRadius"),
                u = this.regionMap,
                a, f, l, c, h, p, d, v, g, y, b, E, S, x, T, N, C, k, L, A, O, M, _, D, P;
            if (!w._super.render.call(this)) return;
            this.scanValues(), this.processRangeOptions(), _ = this.xvalues, D = this.yvalues;
            if (!this.yminmax.length || this.yvalues.length < 2) return;
            c = h = 0, a = this.maxx - this.minx === 0 ? 1 : this.maxx - this.minx, f = this.maxy - this.miny === 0 ? 1 : this.maxy - this.miny, l = this.yvalues.length - 1, o && (r < o * 4 || i < o * 4) && (o = 0);
            if (o) {
                O = t.get("highlightSpotColor") && !t.get("disableInteraction");
                if (O || t.get("minSpotColor") || t.get("spotColor") && D[l] === this.miny) i -= Math.ceil(o);
                if (O || t.get("maxSpotColor") || t.get("spotColor") && D[l] === this.maxy) i -= Math.ceil(o), c += Math.ceil(o);
                if (O || (t.get("minSpotColor") || t.get("maxSpotColor")) && (D[0] === this.miny || D[0] === this.maxy)) h += Math.ceil(o), r -= Math.ceil(o);
                if (O || t.get("spotColor") || t.get("minSpotColor") || t.get("maxSpotColor") && (D[l] === this.miny || D[l] === this.maxy)) r -= Math.ceil(o)
            }
            i--, t.get("normalRangeMin") !== undefined && !t.get("drawNormalOnTop") && this.drawNormalRange(h, c, i, r, f), d = [], v = [d], x = T = null, N = D.length;
            for (P = 0; P < N; P++) g = _[P], b = _[P + 1], y = D[P], E = h + Math.round((g - this.minx) * (r / a)), S = P < N - 1 ? h + Math.round((b - this.minx) * (r / a)) : r, T = E + (S - E) / 2, u[P] = [x || 0, T, P], x = T, y === null ? P && (D[P - 1] !== null && (d = [], v.push(d)), s.push(null)) : (y < this.miny && (y = this.miny), y > this.maxy && (y = this.maxy), d.length || d.push([E, c + i]), p = [E, c + Math.round(i - i * ((y - this.miny) / f))], d.push(p), s.push(p));
            C = [], k = [], L = v.length;
            for (P = 0; P < L; P++) d = v[P], d.length && (t.get("fillColor") && (d.push([d[d.length - 1][0], c + i]), k.push(d.slice(0)), d.pop()), d.length > 2 && (d[0] = [d[0][0], d[1][1]]), C.push(d));
            L = k.length;
            for (P = 0; P < L; P++) n.drawShape(k[P], t.get("fillColor"), t.get("fillColor")).append();
            t.get("normalRangeMin") !== undefined && t.get("drawNormalOnTop") && this.drawNormalRange(h, c, i, r, f), L = C.length;
            for (P = 0; P < L; P++) n.drawShape(C[P], t.get("lineColor"), undefined, t.get("lineWidth")).append();
            if (o && t.get("valueSpots")) {
                A = t.get("valueSpots"), A.get === undefined && (A = new m(A));
                for (P = 0; P < N; P++) M = A.get(D[P]), M && n.drawCircle(h + Math.round((_[P] - this.minx) * (r / a)), c + Math.round(i - i * ((D[P] - this.miny) / f)), o, undefined, M).append()
            }
            o && t.get("spotColor") && D[l] !== null && n.drawCircle(h + Math.round((_[_.length - 1] - this.minx) * (r / a)), c + Math.round(i - i * ((D[l] - this.miny) / f)), o, undefined, t.get("spotColor")).append(), this.maxy !== this.minyorg && (o && t.get("minSpotColor") && (g = _[e.inArray(this.minyorg, D)], n.drawCircle(h + Math.round((g - this.minx) * (r / a)), c + Math.round(i - i * ((this.minyorg - this.miny) / f)), o, undefined, t.get("minSpotColor")).append()), o && t.get("maxSpotColor") && (g = _[e.inArray(this.maxyorg, D)], n.drawCircle(h + Math.round((g - this.minx) * (r / a)), c + Math.round(i - i * ((this.maxyorg - this.miny) / f)), o, undefined, t.get("maxSpotColor")).append())), this.lastShapeId = n.getLastShapeId(), this.canvasTop = c, n.render()
        }
    }), e.fn.sparkline.bar = E = r(e.fn.sparkline._base, b, {
        type: "bar",
        init: function (t, n, r, i, o) {
            var l = parseInt(r.get("barWidth"), 10),
                c = parseInt(r.get("barSpacing"), 10),
                h = r.get("chartRangeMin"),
                p = r.get("chartRangeMax"),
                d = r.get("chartRangeClip"),
                v = Infinity,
                g = -Infinity,
                y, b, w, S, x, T, N, C, k, L, A, O, M, _, D, P, H, B, j, F, I, q, R;
            E._super.init.call(this, t, n, r, i, o);
            for (T = 0, N = n.length; T < N; T++) {
                F = n[T], y = typeof F == "string" && F.indexOf(":") > -1;
                if (y || e.isArray(F)) D = !0, y && (F = n[T] = a(F.split(":"))), F = f(F, null), b = Math.min.apply(Math, F), w = Math.max.apply(Math, F), b < v && (v = b), w > g && (g = w)
            }
            this.stacked = D, this.regionShapes = {}, this.barWidth = l, this.barSpacing = c, this.totalBarWidth = l + c, this.width = i = n.length * l + (n.length - 1) * c, this.initTarget(), d && (M = h === undefined ? -Infinity : h, _ = p === undefined ? Infinity : p), x = [], S = D ? [] : x;
            var U = [],
                z = [];
            for (T = 0, N = n.length; T < N; T++)
                if (D) {
                    P = n[T], n[T] = j = [], U[T] = 0, S[T] = z[T] = 0;
                    for (H = 0, B = P.length; H < B; H++) F = j[H] = d ? s(P[H], M, _) : P[H], F !== null && (F > 0 && (U[T] += F), v < 0 && g > 0 ? F < 0 ? z[T] += Math.abs(F) : S[T] += F : S[T] += Math.abs(F - (F < 0 ? g : v)), x.push(F))
                } else F = d ? s(n[T], M, _) : n[T], F = n[T] = u(F), F !== null && x.push(F);
            this.max = O = Math.max.apply(Math, x), this.min = A = Math.min.apply(Math, x), this.stackMax = g = D ? Math.max.apply(Math, U) : O, this.stackMin = v = D ? Math.min.apply(Math, x) : A, r.get("chartRangeMin") !== undefined && (r.get("chartRangeClip") || r.get("chartRangeMin") < A) && (A = r.get("chartRangeMin")), r.get("chartRangeMax") !== undefined && (r.get("chartRangeClip") || r.get("chartRangeMax") > O) && (O = r.get("chartRangeMax")), this.zeroAxis = k = r.get("zeroAxis", !0), A <= 0 && O >= 0 && k ? L = 0 : k == 0 ? L = A : A > 0 ? L = A : L = O, this.xaxisOffset = L, C = D ? Math.max.apply(Math, S) + Math.max.apply(Math, z) : O - A, this.canvasHeightEf = k && A < 0 ? this.canvasHeight - 2 : this.canvasHeight - 1, A < L ? (q = D && O >= 0 ? g : O, I = (q - L) / C * this.canvasHeight, I !== Math.ceil(I) && (this.canvasHeightEf -= 2, I = Math.ceil(I))) : I = this.canvasHeight, this.yoffset = I, e.isArray(r.get("colorMap")) ? (this.colorMapByIndex = r.get("colorMap"), this.colorMapByValue = null) : (this.colorMapByIndex = null, this.colorMapByValue = r.get("colorMap"), this.colorMapByValue && this.colorMapByValue.get === undefined && (this.colorMapByValue = new m(this.colorMapByValue))), this.range = C
        },
        getRegion: function (e, t, n) {
            var r = Math.floor(t / this.totalBarWidth);
            return r < 0 || r >= this.values.length ? undefined : r
        },
        getCurrentRegionFields: function () {
            var e = this.currentRegion,
                t = d(this.values[e]),
                n = [],
                r, i;
            for (i = t.length; i--;) r = t[i], n.push({
                isNull: r === null,
                value: r,
                color: this.calcColor(i, r, e),
                offset: e
            });
            return n
        },
        calcColor: function (t, n, r) {
            var i = this.colorMapByIndex,
                s = this.colorMapByValue,
                o = this.options,
                u, a;
            return this.stacked ? u = o.get("stackedBarColor") : u = n < 0 ? o.get("negBarColor") : o.get("barColor"), n === 0 && o.get("zeroColor") !== undefined && (u = o.get("zeroColor")), s && (a = s.get(n)) ? u = a : i && i.length > r && (u = i[r]), e.isArray(u) ? u[t % u.length] : u
        },
        renderRegion: function (t, n) {
            var r = this.values[t],
                i = this.options,
                s = this.xaxisOffset,
                o = [],
                u = this.range,
                a = this.stacked,
                f = this.target,
                l = t * this.totalBarWidth,
                h = this.canvasHeightEf,
                p = this.yoffset,
                d, v, m, g, y, b, w, E, S, x;
            r = e.isArray(r) ? r : [r], w = r.length, E = r[0], g = c(null, r), x = c(s, r, !0);
            if (g) return i.get("nullColor") ? (m = n ? i.get("nullColor") : this.calcHighlightColor(i.get("nullColor"), i), d = p > 0 ? p - 1 : p, f.drawRect(l, d, this.barWidth - 1, 0, m, m)) : undefined;
            y = p;
            for (b = 0; b < w; b++) {
                E = r[b];
                if (a && E === s) {
                    if (!x || S) continue;
                    S = !0
                }
                u > 0 ? v = Math.floor(h * (Math.abs(E - s) / u)) + 1 : v = 1, E < s || E === s && p === 0 ? (d = y, y += v) : (d = p - v, p -= v), m = this.calcColor(b, E, t), n && (m = this.calcHighlightColor(m, i)), o.push(f.drawRect(l, d, this.barWidth - 1, v - 1, m, m))
            }
            return o.length === 1 ? o[0] : o
        }
    }), e.fn.sparkline.tristate = S = r(e.fn.sparkline._base, b, {
        type: "tristate",
        init: function (t, n, r, i, s) {
            var o = parseInt(r.get("barWidth"), 10),
                u = parseInt(r.get("barSpacing"), 10);
            S._super.init.call(this, t, n, r, i, s), this.regionShapes = {}, this.barWidth = o, this.barSpacing = u, this.totalBarWidth = o + u, this.values = e.map(n, Number), this.width = i = n.length * o + (n.length - 1) * u, e.isArray(r.get("colorMap")) ? (this.colorMapByIndex = r.get("colorMap"), this.colorMapByValue = null) : (this.colorMapByIndex = null, this.colorMapByValue =
                r.get("colorMap"), this.colorMapByValue && this.colorMapByValue.get === undefined && (this.colorMapByValue = new m(this.colorMapByValue))), this.initTarget()
        },
        getRegion: function (e, t, n) {
            return Math.floor(t / this.totalBarWidth)
        },
        getCurrentRegionFields: function () {
            var e = this.currentRegion;
            return {
                isNull: this.values[e] === undefined,
                value: this.values[e],
                color: this.calcColor(this.values[e], e),
                offset: e
            }
        },
        calcColor: function (e, t) {
            var n = this.values,
                r = this.options,
                i = this.colorMapByIndex,
                s = this.colorMapByValue,
                o, u;
            return s && (u = s.get(e)) ? o = u : i && i.length > t ? o = i[t] : n[t] < 0 ? o = r.get("negBarColor") : n[t] > 0 ? o = r.get("posBarColor") : o = r.get("zeroBarColor"), o
        },
        renderRegion: function (e, t) {
            var n = this.values,
                r = this.options,
                i = this.target,
                s, o, u, a, f, l;
            s = i.pixelHeight, u = Math.round(s / 2), a = e * this.totalBarWidth, n[e] < 0 ? (f = u, o = u - 1) : n[e] > 0 ? (f = 0, o = u - 1) : (f = u - 1, o = 2), l = this.calcColor(n[e], e);
            if (l === null) return;
            return t && (l = this.calcHighlightColor(l, r)), i.drawRect(a, f, this.barWidth - 1, o - 1, l, l)
        }
    }), e.fn.sparkline.discrete = x = r(e.fn.sparkline._base, b, {
        type: "discrete",
        init: function (t, n, r, i, s) {
            x._super.init.call(this, t, n, r, i, s), this.regionShapes = {}, this.values = n = e.map(n, Number), this.min = Math.min.apply(Math, n), this.max = Math.max.apply(Math, n), this.range = this.max - this.min, this.width = i = r.get("width") === "auto" ? n.length * 2 : this.width, this.interval = Math.floor(i / n.length), this.itemWidth = i / n.length, r.get("chartRangeMin") !== undefined && (r.get("chartRangeClip") || r.get("chartRangeMin") < this.min) && (this.min = r.get("chartRangeMin")), r.get("chartRangeMax") !== undefined && (r.get("chartRangeClip") || r.get("chartRangeMax") > this.max) && (this.max = r.get("chartRangeMax")), this.initTarget(), this.target && (this.lineHeight = r.get("lineHeight") === "auto" ? Math.round(this.canvasHeight * .3) : r.get("lineHeight"))
        },
        getRegion: function (e, t, n) {
            return Math.floor(t / this.itemWidth)
        },
        getCurrentRegionFields: function () {
            var e = this.currentRegion;
            return {
                isNull: this.values[e] === undefined,
                value: this.values[e],
                offset: e
            }
        },
        renderRegion: function (e, t) {
            var n = this.values,
                r = this.options,
                i = this.min,
                o = this.max,
                u = this.range,
                a = this.interval,
                f = this.target,
                l = this.canvasHeight,
                c = this.lineHeight,
                h = l - c,
                p, d, v, m;
            return d = s(n[e], i, o), m = e * a, p = Math.round(h - h * ((d - i) / u)), v = r.get("thresholdColor") && d < r.get("thresholdValue") ? r.get("thresholdColor") : r.get("lineColor"), t && (v = this.calcHighlightColor(v, r)), f.drawLine(m, p, m, p + c, v)
        }
    }), e.fn.sparkline.bullet = T = r(e.fn.sparkline._base, {
        type: "bullet",
        init: function (e, t, n, r, i) {
            var s, o, u;
            T._super.init.call(this, e, t, n, r, i), this.values = t = a(t), u = t.slice(), u[0] = u[0] === null ? u[2] : u[0], u[1] = t[1] === null ? u[2] : u[1], s = Math.min.apply(Math, t), o = Math.max.apply(Math, t), n.get("base") === undefined ? s = s < 0 ? s : 0 : s = n.get("base"), this.min = s, this.max = o, this.range = o - s, this.shapes = {}, this.valueShapes = {}, this.regiondata = {}, this.width = r = n.get("width") === "auto" ? "4.0em" : r, this.target = this.$el.simpledraw(r, i, n.get("composite")), t.length || (this.disabled = !0), this.initTarget()
        },
        getRegion: function (e, t, n) {
            var r = this.target.getShapeAt(e, t, n);
            return r !== undefined && this.shapes[r] !== undefined ? this.shapes[r] : undefined
        },
        getCurrentRegionFields: function () {
            var e = this.currentRegion;
            return {
                fieldkey: e.substr(0, 1),
                value: this.values[e.substr(1)],
                region: e
            }
        },
        changeHighlight: function (e) {
            var t = this.currentRegion,
                n = this.valueShapes[t],
                r;
            delete this.shapes[n];
            switch (t.substr(0, 1)) {
            case "r":
                r = this.renderRange(t.substr(1), e);
                break;
            case "p":
                r = this.renderPerformance(e);
                break;
            case "t":
                r = this.renderTarget(e)
            }
            this.valueShapes[t] = r.id, this.shapes[r.id] = t, this.target.replaceWithShape(n, r)
        },
        renderRange: function (e, t) {
            var n = this.values[e],
                r = Math.round(this.canvasWidth * ((n - this.min) / this.range)),
                i = this.options.get("rangeColors")[e - 2];
            return t && (i = this.calcHighlightColor(i, this.options)), this.target.drawRect(0, 0, r - 1, this.canvasHeight - 1, i, i)
        },
        renderPerformance: function (e) {
            var t = this.values[1],
                n = Math.round(this.canvasWidth * ((t - this.min) / this.range)),
                r = this.options.get("performanceColor");
            return e && (r = this.calcHighlightColor(r, this.options)), this.target.drawRect(0, Math.round(this.canvasHeight * .3), n - 1, Math.round(this.canvasHeight * .4) - 1, r, r)
        },
        renderTarget: function (e) {
            var t = this.values[0],
                n = Math.round(this.canvasWidth * ((t - this.min) / this.range) - this.options.get("targetWidth") / 2),
                r = Math.round(this.canvasHeight * .1),
                i = this.canvasHeight - r * 2,
                s = this.options.get("targetColor");
            return e && (s = this.calcHighlightColor(s, this.options)), this.target.drawRect(n, r, this.options.get("targetWidth") - 1, i - 1, s, s)
        },
        render: function () {
            var e = this.values.length,
                t = this.target,
                n, r;
            if (!T._super.render.call(this)) return;
            for (n = 2; n < e; n++) r = this.renderRange(n).append(), this.shapes[r.id] = "r" + n, this.valueShapes["r" + n] = r.id;
            this.values[1] !== null && (r = this.renderPerformance().append(), this.shapes[r.id] = "p1", this.valueShapes.p1 = r.id), this.values[0] !== null && (r = this.renderTarget().append(), this.shapes[r.id] = "t0", this.valueShapes.t0 = r.id), t.render()
        }
    }), e.fn.sparkline.pie = N = r(e.fn.sparkline._base, {
        type: "pie",
        init: function (t, n, r, i, s) {
            var o = 0,
                u;
            N._super.init.call(this, t, n, r, i, s), this.shapes = {}, this.valueShapes = {}, this.values = n = e.map(n, Number), r.get("width") === "auto" && (this.width = this.height);
            if (n.length > 0)
                for (u = n.length; u--;) o += n[u];
            this.total = o, this.initTarget(), this.radius = Math.floor(Math.min(this.canvasWidth, this.canvasHeight) / 2)
        },
        getRegion: function (e, t, n) {
            var r = this.target.getShapeAt(e, t, n);
            return r !== undefined && this.shapes[r] !== undefined ? this.shapes[r] : undefined
        },
        getCurrentRegionFields: function () {
            var e = this.currentRegion;
            return {
                isNull: this.values[e] === undefined,
                value: this.values[e],
                percent: this.values[e] / this.total * 100,
                color: this.options.get("sliceColors")[e % this.options.get("sliceColors").length],
                offset: e
            }
        },
        changeHighlight: function (e) {
            var t = this.currentRegion,
                n = this.renderSlice(t, e),
                r = this.valueShapes[t];
            delete this.shapes[r], this.target.replaceWithShape(r, n), this.valueShapes[t] = n.id, this.shapes[n.id] = t
        },
        renderSlice: function (e, t) {
            var n = this.target,
                r = this.options,
                i = this.radius,
                s = r.get("borderWidth"),
                o = r.get("offset"),
                u = 2 * Math.PI,
                a = this.values,
                f = this.total,
                l = o ? 2 * Math.PI * (o / 360) : 0,
                c, h, p, d, v;
            d = a.length;
            for (p = 0; p < d; p++) {
                c = l, h = l, f > 0 && (h = l + u * (a[p] / f));
                if (e === p) return v = r.get("sliceColors")[p % r.get("sliceColors").length], t && (v = this.calcHighlightColor(v, r)), n.drawPieSlice(i, i, i - s, c, h, undefined, v);
                l = h
            }
        },
        render: function () {
            var e = this.target,
                t = this.values,
                n = this.options,
                r = this.radius,
                i = n.get("borderWidth"),
                s, o;
            if (!N._super.render.call(this)) return;
            i && e.drawCircle(r, r, Math.floor(r - i / 2), n.get("borderColor"), undefined, i).append();
            for (o = t.length; o--;) t[o] && (s = this.renderSlice(o).append(), this.valueShapes[o] = s.id, this.shapes[s.id] = o);
            e.render()
        }
    }), e.fn.sparkline.box = C = r(e.fn.sparkline._base, {
        type: "box",
        init: function (t, n, r, i, s) {
            C._super.init.call(this, t, n, r, i, s), this.values = e.map(n, Number), this.width = r.get("width") === "auto" ? "4.0em" : i, this.initTarget(), this.values.length || (this.disabled = 1)
        },
        getRegion: function () {
            return 1
        },
        getCurrentRegionFields: function () {
            var e = [{
                field: "lq",
                value: this.quartiles[0]
            }, {
                field: "med",
                value: this.quartiles[1]
            }, {
                field: "uq",
                value: this.quartiles[2]
            }];
            return this.loutlier !== undefined && e.push({
                field: "lo",
                value: this.loutlier
            }), this.routlier !== undefined && e.push({
                field: "ro",
                value: this.routlier
            }), this.lwhisker !== undefined && e.push({
                field: "lw",
                value: this.lwhisker
            }), this.rwhisker !== undefined && e.push({
                field: "rw",
                value: this.rwhisker
            }), e
        },
        render: function () {
            var e = this.target,
                t = this.values,
                n = t.length,
                r = this.options,
                i = this.canvasWidth,
                s = this.canvasHeight,
                u = r.get("chartRangeMin") === undefined ? Math.min.apply(Math, t) : r.get("chartRangeMin"),
                a = r.get("chartRangeMax") === undefined ? Math.max.apply(Math, t) : r.get("chartRangeMax"),
                f = 0,
                l, c, h, p, d, v, m, g, y, b, w;
            if (!C._super.render.call(this)) return;
            if (r.get("raw")) r.get("showOutliers") && t.length > 5 ? (c = t[0], l = t[1], p = t[2], d = t[3], v = t[4], m = t[5], g = t[6]) : (l = t[0], p = t[1], d = t[2], v = t[3], m = t[4]);
            else {
                t.sort(function (e, t) {
                    return e - t
                }), p = o(t, 1), d = o(t, 2), v = o(t, 3), h = v - p;
                if (r.get("showOutliers")) {
                    l = m = undefined;
                    for (y = 0; y < n; y++) l === undefined && t[y] > p - h * r.get("outlierIQR") && (l = t[y]), t[y] < v + h * r.get("outlierIQR") && (m = t[y]);
                    c = t[0], g = t[n - 1]
                } else l = t[0], m = t[n - 1]
            }
            this.quartiles = [p, d, v], this.lwhisker = l, this.rwhisker = m, this.loutlier = c, this.routlier = g, w = i / (a - u + 1), r.get("showOutliers") && (f = Math.ceil(r.get("spotRadius")), i -= 2 * Math.ceil(r.get("spotRadius")), w = i / (a - u + 1), c < l && e.drawCircle((c - u) * w + f, s / 2, r.get("spotRadius"), r.get("outlierLineColor"), r.get("outlierFillColor")).append(), g > m && e.drawCircle((g - u) * w + f, s / 2, r.get("spotRadius"), r.get("outlierLineColor"), r.get("outlierFillColor")).append()), e.drawRect(Math.round((p - u) * w + f), Math.round(s * .1), Math.round((v - p) * w), Math.round(s * .8), r.get("boxLineColor"), r.get("boxFillColor")).append(), e.drawLine(Math.round((l - u) * w + f), Math.round(s / 2), Math.round((p - u) * w + f), Math.round(s / 2), r.get("lineColor")).append(), e.drawLine(Math.round((l - u) * w + f), Math.round(s / 4), Math.round((l - u) * w + f), Math.round(s - s / 4), r.get("whiskerColor")).append(), e.drawLine(Math.round((m - u) * w + f), Math.round(s / 2), Math.round((v - u) * w + f), Math.round(s / 2), r.get("lineColor")).append(), e.drawLine(Math.round((m - u) * w + f), Math.round(s / 4), Math.round((m - u) * w + f), Math.round(s - s / 4), r.get("whiskerColor")).append(), e.drawLine(Math.round((d - u) * w + f), Math.round(s * .1), Math.round((d - u) * w + f), Math.round(s * .9), r.get("medianColor")).append(), r.get("target") && (b = Math.ceil(r.get("spotRadius")), e.drawLine(Math.round((r.get("target") - u) * w + f), Math.round(s / 2 - b), Math.round((r.get("target") - u) * w + f), Math.round(s / 2 + b), r.get("targetColor")).append(), e.drawLine(Math.round((r.get("target") - u) * w + f - b), Math.round(s / 2), Math.round((r.get("target") - u) * w + f + b), Math.round(s / 2), r.get("targetColor")).append()), e.render()
        }
    }),
    function () {
        document.namespaces && !document.namespaces.v ? (e.fn.sparkline.hasVML = !0, document.namespaces.add("v", "urn:schemas-microsoft-com:vml", "#default#VML")) : e.fn.sparkline.hasVML = !1;
        var t = document.createElement("canvas");
        e.fn.sparkline.hasCanvas = !! t.getContext && !! t.getContext("2d")
    }(), A = r({
        init: function (e, t, n, r) {
            this.target = e, this.id = t, this.type = n, this.args = r
        },
        append: function () {
            return this.target.appendShape(this), this
        }
    }), O = r({
        _pxregex: /(\d+)(px)?\s*$/i,
        init: function (t, n, r) {
            if (!t) return;
            this.width = t, this.height = n, this.target = r, this.lastShapeId = null, r[0] && (r = r[0]), e.data(r, "_jqs_vcanvas", this)
        },
        drawLine: function (e, t, n, r, i, s) {
            return this.drawShape([
                [e, t],
                [n, r]
            ], i, s)
        },
        drawShape: function (e, t, n, r) {
            return this._genShape("Shape", [e, t, n, r])
        },
        drawCircle: function (e, t, n, r, i, s) {
            return this._genShape("Circle", [e, t, n, r, i, s])
        },
        drawPieSlice: function (e, t, n, r, i, s, o) {
            return this._genShape("PieSlice", [e, t, n, r, i, s, o])
        },
        drawRect: function (e, t, n, r, i, s) {
            return this._genShape("Rect", [e, t, n, r, i, s])
        },
        getElement: function () {
            return this.canvas
        },
        getLastShapeId: function () {
            return this.lastShapeId
        },
        reset: function () {
            alert("reset not implemented")
        },
        _insert: function (t, n) {
            e(n).html(t)
        },
        _calculatePixelDims: function (t, n, r) {
            var i;
            i = this._pxregex.exec(n), i ? this.pixelHeight = i[1] : this.pixelHeight = e(r).height(), i = this._pxregex.exec(t), i ? this.pixelWidth = i[1] : this.pixelWidth = e(r).width()
        },
        _genShape: function (e, t) {
            var n = P++;
            return t.unshift(n), new A(this, n, e, t)
        },
        appendShape: function (e) {
            alert("appendShape not implemented")
        },
        replaceWithShape: function (e, t) {
            alert("replaceWithShape not implemented")
        },
        insertAfterShape: function (e, t) {
            alert("insertAfterShape not implemented")
        },
        removeShapeId: function (e) {
            alert("removeShapeId not implemented")
        },
        getShapeAt: function (e, t, n) {
            alert("getShapeAt not implemented")
        },
        render: function () {
            alert("render not implemented")
        }
    }), M = r(O, {
        init: function (t, n, r, i) {
            M._super.init.call(this, t, n, r), this.canvas = document.createElement("canvas"), r[0] && (r = r[0]), e.data(r, "_jqs_vcanvas", this), e(this.canvas).css({
                display: "inline-block",
                width: t,
                height: n,
                verticalAlign: "top"
            }), this._insert(this.canvas, r), this._calculatePixelDims(t, n, this.canvas), this.canvas.width = this.pixelWidth, this.canvas.height = this.pixelHeight, this.interact = i, this.shapes = {}, this.shapeseq = [], this.currentTargetShapeId = undefined, e(this.canvas).css({
                width: this.pixelWidth,
                height: this.pixelHeight
            })
        },
        _getContext: function (e, t, n) {
            var r = this.canvas.getContext("2d");
            return e !== undefined && (r.strokeStyle = e), r.lineWidth = n === undefined ? 1 : n, t !== undefined && (r.fillStyle = t), r
        },
        reset: function () {
            var e = this._getContext();
            e.clearRect(0, 0, this.pixelWidth, this.pixelHeight), this.shapes = {}, this.shapeseq = [], this.currentTargetShapeId = undefined
        },
        _drawShape: function (e, t, n, r, i) {
            var s = this._getContext(n, r, i),
                o, u;
            s.beginPath(), s.moveTo(t[0][0] + .5, t[0][1] + .5);
            for (o = 1, u = t.length; o < u; o++) s.lineTo(t[o][0] + .5, t[o][1] + .5);
            n !== undefined && s.stroke(), r !== undefined && s.fill(), this.targetX !== undefined && this.targetY !== undefined && s.isPointInPath(this.targetX, this.targetY) && (this.currentTargetShapeId = e)
        },
        _drawCircle: function (e, t, n, r, i, s, o) {
            var u = this._getContext(i, s, o);
            u.beginPath(), u.arc(t, n, r, 0, 2 * Math.PI, !1), this.targetX !== undefined && this.targetY !== undefined && u.isPointInPath(this.targetX, this.targetY) && (this.currentTargetShapeId = e), i !== undefined && u.stroke(), s !== undefined && u.fill()
        },
        _drawPieSlice: function (e, t, n, r, i, s, o, u) {
            var a = this._getContext(o, u);
            a.beginPath(), a.moveTo(t, n), a.arc(t, n, r, i, s, !1), a.lineTo(t, n), a.closePath(), o !== undefined && a.stroke(), u && a.fill(), this.targetX !== undefined && this.targetY !== undefined && a.isPointInPath(this.targetX, this.targetY) && (this.currentTargetShapeId = e)
        },
        _drawRect: function (e, t, n, r, i, s, o) {
            return this._drawShape(e, [
                [t, n],
                [t + r, n],
                [t + r, n + i],
                [t, n + i],
                [t, n]
            ], s, o)
        },
        appendShape: function (e) {
            return this.shapes[e.id] = e, this.shapeseq.push(e.id), this.lastShapeId = e.id, e.id
        },
        replaceWithShape: function (e, t) {
            var n = this.shapeseq,
                r;
            this.shapes[t.id] = t;
            for (r = n.length; r--;) n[r] == e && (n[r] = t.id);
            delete this.shapes[e]
        },
        replaceWithShapes: function (e, t) {
            var n = this.shapeseq,
                r = {}, i, s, o;
            for (s = e.length; s--;) r[e[s]] = !0;
            for (s = n.length; s--;) i = n[s], r[i] && (n.splice(s, 1), delete this.shapes[i], o = s);
            for (s = t.length; s--;) n.splice(o, 0, t[s].id), this.shapes[t[s].id] = t[s]
        },
        insertAfterShape: function (e, t) {
            var n = this.shapeseq,
                r;
            for (r = n.length; r--;)
                if (n[r] === e) {
                    n.splice(r + 1, 0, t.id), this.shapes[t.id] = t;
                    return
                }
        },
        removeShapeId: function (e) {
            var t = this.shapeseq,
                n;
            for (n = t.length; n--;)
                if (t[n] === e) {
                    t.splice(n, 1);
                    break
                }
            delete this.shapes[e]
        },
        getShapeAt: function (e, t, n) {
            return this.targetX = t, this.targetY = n, this.render(), this.currentTargetShapeId
        },
        render: function () {
            var e = this.shapeseq,
                t = this.shapes,
                n = e.length,
                r = this._getContext(),
                i, s, o;
            r.clearRect(0, 0, this.pixelWidth, this.pixelHeight);
            for (o = 0; o < n; o++) i = e[o], s = t[i], this["_draw" + s.type].apply(this, s.args);
            this.interact || (this.shapes = {}, this.shapeseq = [])
        }
    }), _ = r(O, {
        init: function (t, n, r) {
            var i;
            _._super.init.call(this, t, n, r), r[0] && (r = r[0]), e.data(r, "_jqs_vcanvas", this), this.canvas = document.createElement("span"), e(this.canvas).css({
                display: "inline-block",
                position: "relative",
                overflow: "hidden",
                width: t,
                height: n,
                margin: "0px",
                padding: "0px",
                verticalAlign: "top"
            }), this._insert(this.canvas, r), this._calculatePixelDims(t, n, this.canvas), this.canvas.width = this.pixelWidth, this.canvas.height = this.pixelHeight, i = '<v:group coordorigin="0 0" coordsize="' + this.pixelWidth + " " + this.pixelHeight + '"' + ' style="position:absolute;top:0;left:0;width:' + this.pixelWidth + "px;height=" + this.pixelHeight + 'px;"></v:group>', this.canvas.insertAdjacentHTML("beforeEnd", i), this.group = e(this.canvas).children()[0], this.rendered = !1, this.prerender = ""
        },
        _drawShape: function (e, t, n, r, i) {
            var s = [],
                o, u, a, f, l, c, h;
            for (h = 0, c = t.length; h < c; h++) s[h] = "" + t[h][0] + "," + t[h][1];
            return o = s.splice(0, 1), i = i === undefined ? 1 : i, u = n === undefined ? ' stroked="false" ' : ' strokeWeight="' + i + 'px" strokeColor="' + n + '" ', a = r === undefined ? ' filled="false"' : ' fillColor="' + r + '" filled="true" ', f = s[0] === s[s.length - 1] ? "x " : "", l = '<v:shape coordorigin="0 0" coordsize="' + this.pixelWidth + " " + this.pixelHeight + '" ' + ' id="jqsshape' + e + '" ' + u + a + ' style="position:absolute;left:0px;top:0px;height:' + this.pixelHeight + "px;width:" + this.pixelWidth + 'px;padding:0px;margin:0px;" ' + ' path="m ' + o + " l " + s.join(", ") + " " + f + 'e">' + " </v:shape>", l
        },
        _drawCircle: function (e, t, n, r, i, s, o) {
            var u, a, f;
            return t -= r, n -= r, u = i === undefined ? ' stroked="false" ' : ' strokeWeight="' + o + 'px" strokeColor="' + i + '" ', a = s === undefined ? ' filled="false"' : ' fillColor="' + s + '" filled="true" ', f = '<v:oval  id="jqsshape' + e + '" ' + u + a + ' style="position:absolute;top:' + n + "px; left:" + t + "px; width:" + r * 2 + "px; height:" + r * 2 + 'px"></v:oval>', f
        },
        _drawPieSlice: function (e, t, n, r, i, s, o, u) {
            var a, f, l, c, h, p, d, v;
            if (i === s) return "";
            s - i === 2 * Math.PI && (i = 0, s = 2 * Math.PI), f = t + Math.round(Math.cos(i) * r), l = n + Math.round(Math.sin(i) * r), c = t + Math.round(Math.cos(s) * r), h = n + Math.round(Math.sin(s) * r);
            if (f === c && l === h) {
                if (s - i < Math.PI) return "";
                f = c = t + r, l = h = n
            }
            return f === c && l === h && s - i < Math.PI ? "" : (a = [t - r, n - r, t + r, n + r, f, l, c, h], p = o === undefined ? ' stroked="false" ' : ' strokeWeight="1px" strokeColor="' + o + '" ', d = u === undefined ? ' filled="false"' : ' fillColor="' + u + '" filled="true" ', v = '<v:shape coordorigin="0 0" coordsize="' + this.pixelWidth + " " + this.pixelHeight + '" ' + ' id="jqsshape' + e + '" ' + p + d + ' style="position:absolute;left:0px;top:0px;height:' + this.pixelHeight + "px;width:" + this.pixelWidth + 'px;padding:0px;margin:0px;" ' + ' path="m ' + t + "," + n + " wa " + a.join(", ") + ' x e">' + " </v:shape>", v)
        },
        _drawRect: function (e, t, n, r, i, s, o) {
            return this._drawShape(e, [
                [t, n],
                [t, n + i],
                [t + r, n + i],
                [t + r, n],
                [t, n]
            ], s, o)
        },
        reset: function () {
            this.group.innerHTML = ""
        },
        appendShape: function (e) {
            var t = this["_draw" + e.type].apply(this, e.args);
            return this.rendered ? this.group.insertAdjacentHTML("beforeEnd", t) : this.prerender += t, this.lastShapeId = e.id, e.id
        },
        replaceWithShape: function (t, n) {
            var r = e("#jqsshape" + t),
                i = this["_draw" + n.type].apply(this, n.args);
            r[0].outerHTML = i
        },
        replaceWithShapes: function (t, n) {
            var r = e("#jqsshape" + t[0]),
                i = "",
                s = n.length,
                o;
            for (o = 0; o < s; o++) i += this["_draw" + n[o].type].apply(this, n[o].args);
            r[0].outerHTML = i;
            for (o = 1; o < t.length; o++) e("#jqsshape" + t[o]).remove()
        },
        insertAfterShape: function (t, n) {
            var r = e("#jqsshape" + t),
                i = this["_draw" + n.type].apply(this, n.args);
            r[0].insertAdjacentHTML("afterEnd", i)
        },
        removeShapeId: function (t) {
            var n = e("#jqsshape" + t);
            this.group.removeChild(n[0])
        },
        getShapeAt: function (e, t, n) {
            var r = e.id.substr(8);
            return r
        },
        render: function () {
            this.rendered || (this.group.innerHTML = this.prerender, this.rendered = !0)
        }
    })
}),
function (e) {
    var t = new Array,
        n = new Array;
    e.fn.doAutosize = function (t) {
        var n = e(this).data("minwidth"),
            r = e(this).data("maxwidth"),
            i = "",
            s = e(this),
            o = e("#" + e(this).data("tester_id"));
        if (i === (i = s.val())) return;
        var u = i.replace(/&/g, "&amp;").replace(/\s/g, " ").replace(/</g, "&lt;").replace(/>/g, "&gt;");
        o.html(u);
        var a = o.width(),
            f = a + t.comfortZone >= n ? a + t.comfortZone : n,
            l = s.width(),
            c = f < l && f >= n || f > n && f < r;
        c && s.width(f)
    }, e.fn.resetAutosize = function (t) {
        var n = e(this).data("minwidth") || t.minInputWidth || e(this).width(),
            r = e(this).data("maxwidth") || t.maxInputWidth || e(this).closest(".tagsinput").width() - t.inputPadding,
            i = "",
            s = e(this),
            o = e("<tester/>").css({
                position: "absolute",
                top: -9999,
                left: -9999,
                width: "auto",
                fontSize: s.css("fontSize"),
                fontFamily: s.css("fontFamily"),
                fontWeight: s.css("fontWeight"),
                letterSpacing: s.css("letterSpacing"),
                whiteSpace: "nowrap"
            }),
            u = e(this).attr("id") + "_autosize_tester";
        !e("#" + u).length > 0 && (o.attr("id", u), o.appendTo("body")), s.data("minwidth", n), s.data("maxwidth", r), s.data("tester_id", u), s.css("width", n)
    }, e.fn.addTag = function (r, i) {
        return i = jQuery.extend({
            focus: !1,
            callback: !0
        }, i), this.each(function () {
            var s = e(this).attr("id"),
                o = e(this).val().split(t[s]);
            o[0] == "" && (o = new Array), r = jQuery.trim(r);
            if (i.unique) {
                var u = e(this).tagExist(r);
                u == 1 && e("#" + s + "_tag").addClass("not_valid")
            } else var u = !1; if (r != "" && u != 1) {
                e("<span>").addClass("tag").append(e("<span>").text(r).append("&nbsp;&nbsp;"), e("<a>", {
                    href: "#",
                    title: "Removing tag",
                    html: '<i class="icon-remove"></i>'
                }).click(function () {
                    return e("#" + s).removeTag(escape(r))
                })).insertBefore("#" + s + "_addTag"), o.push(r), e("#" + s + "_tag").val(""), i.focus ? e("#" + s + "_tag").focus() : e("#" + s + "_tag").blur(), e.fn.tagsInput.updateTagsField(this, o);
                if (i.callback && n[s] && n[s].onAddTag) {
                    var a = n[s].onAddTag;
                    a.call(this, r)
                }
                if (n[s] && n[s].onChange) {
                    var f = o.length,
                        a = n[s].onChange;
                    a.call(this, e(this), o[f - 1])
                }
            }
        }), !1
    }, e.fn.removeTag = function (r) {
        return r = unescape(r), this.each(function () {
            var s = e(this).attr("id"),
                o = e(this).val().split(t[s]);
            e("#" + s + "_tagsinput .tag").remove(), str = "";
            for (i = 0; i < o.length; i++) o[i] != r && (str = str + t[s] + o[i]);
            e.fn.tagsInput.importTags(this, str);
            if (n[s] && n[s].onRemoveTag) {
                var u = n[s].onRemoveTag;
                u.call(this, r)
            }
        }), !1
    }, e.fn.tagExist = function (n) {
        var r = e(this).attr("id"),
            i = e(this).val().split(t[r]);
        return jQuery.inArray(n, i) >= 0
    }, e.fn.importTags = function (t) {
        id = e(this).attr("id"), e("#" + id + "_tagsinput .tag").remove(), e.fn.tagsInput.importTags(this, t)
    }, e.fn.tagsInput = function (r) {
        var i = jQuery.extend({
            interactive: !0,
            defaultText: "add a tag",
            minChars: 0,
            width: "300px",
            height: "100px",
            autocomplete: {
                selectFirst: !1
            },
            hide: !0,
            delimiter: ",",
            unique: !0,
            removeWithBackspace: !0,
            placeholderColor: "#666666",
            autosize: !0,
            comfortZone: 20,
            inputPadding: 12
        }, r);
        return this.each(function () {
            i.hide && e(this).hide();
            var r = e(this).attr("id");
            if (!r || t[e(this).attr("id")]) r = e(this).attr("id", "tags" + (new Date).getTime()).attr("id");
            var s = jQuery.extend({
                pid: r,
                real_input: "#" + r,
                holder: "#" + r + "_tagsinput",
                input_wrapper: "#" + r + "_addTag",
                fake_input: "#" + r + "_tag"
            }, i);
            t[r] = s.delimiter;
            if (i.onAddTag || i.onRemoveTag || i.onChange) n[r] = new Array, n[r].onAddTag = i.onAddTag, n[r].onRemoveTag = i.onRemoveTag, n[r].onChange = i.onChange;
            var o = '<div id="' + r + '_tagsinput" class="tagsinput"><div id="' + r + '_addTag">';
            i.interactive && (o = o + '<input id="' + r + '_tag" value="" data-default="' + i.defaultText + '" />'), o += '</div><div class="tags_clear"></div></div>', e(o).insertAfter(this), e(s.holder).css("width", i.width), e(s.real_input).val() != "" && e.fn.tagsInput.importTags(e(s.real_input), e(s.real_input).val());
            if (i.interactive) {
                e(s.fake_input).val(e(s.fake_input).attr("data-default")), e(s.fake_input).css("color", i.placeholderColor), e(s.fake_input).resetAutosize(i), e(s.holder).bind("click", s, function (t) {
                    e(t.data.fake_input).focus()
                }), e(s.fake_input).bind("focus", s, function (t) {
                    e(t.data.fake_input).val() == e(t.data.fake_input).attr("data-default") && e(t.data.fake_input).val(""), e(t.data.fake_input).css("color", "#000000")
                });
                if (i.autocomplete_url != undefined) {
                    autocomplete_options = {
                        source: i.autocomplete_url
                    };
                    for (attrname in i.autocomplete) autocomplete_options[attrname] = i.autocomplete[attrname];
                    jQuery.Autocompleter !== undefined ? (e(s.fake_input).autocomplete(i.autocomplete_url, i.autocomplete), e(s.fake_input).bind("result", s, function (t, n, s) {
                        n && e("#" + r).addTag(n[0] + "", {
                            focus: !0,
                            unique: i.unique
                        })
                    })) : jQuery.ui.autocomplete !== undefined && (e(s.fake_input).autocomplete(autocomplete_options), e(s.fake_input).bind("autocompleteselect", s, function (t, n) {
                        return e(t.data.real_input).addTag(n.item.value, {
                            focus: !0,
                            unique: i.unique
                        }), !1
                    }))
                } else e(s.fake_input).bind("blur", s, function (t) {
                    var n = e(this).attr("data-default");
                    return e(t.data.fake_input).val() != "" && e(t.data.fake_input).val() != n ? t.data.minChars <= e(t.data.fake_input).val().length && (!t.data.maxChars || t.data.maxChars >= e(t.data.fake_input).val().length) && e(t.data.real_input).addTag(e(t.data.fake_input).val(), {
                        focus: !0,
                        unique: i.unique
                    }) : (e(t.data.fake_input).val(e(t.data.fake_input).attr("data-default")), e(t.data.fake_input).css("color", i.placeholderColor)), !1
                });
                e(s.fake_input).bind("keypress", s, function (t) {
                    if (t.which == t.data.delimiter.charCodeAt(0) || t.which == 13) return t.preventDefault(), t.data.minChars <= e(t.data.fake_input).val().length && (!t.data.maxChars || t.data.maxChars >= e(t.data.fake_input).val().length) && e(t.data.real_input).addTag(e(t.data.fake_input).val(), {
                        focus: !0,
                        unique: i.unique
                    }), e(t.data.fake_input).resetAutosize(i), !1;
                    t.data.autosize && e(t.data.fake_input).doAutosize(i)
                }), s.removeWithBackspace && e(s.fake_input).bind("keydown", function (t) {
                    if (t.keyCode == 8 && e(this).val() == "") {
                        t.preventDefault();
                        var n = e(this).closest(".tagsinput").find(".tag:last").text(),
                            r = e(this).attr("id").replace(/_tag$/, "");
                        n = n.replace(/[\s]+x$/, ""), e("#" + r).removeTag(escape(n)), e(this).trigger("focus")
                    }
                }), e(s.fake_input).blur(), s.unique && e(s.fake_input).keydown(function (t) {
                    (t.keyCode == 8 || String.fromCharCode(t.which).match(/\w+|[áéíóúÁÉÍÓÚñÑ,/]+/)) && e(this).removeClass("not_valid")
                })
            }
        }), this
    }, e.fn.tagsInput.updateTagsField = function (n, r) {
        var i = e(n).attr("id");
        e(n).val(r.join(t[i]))
    }, e.fn.tagsInput.importTags = function (r, s) {
        e(r).val("");
        var o = e(r).attr("id"),
            u = s.split(t[o]);
        for (i = 0; i < u.length; i++) e(r).addTag(u[i], {
            focus: !1,
            callback: !1
        });
        if (n[o] && n[o].onChange) {
            var a = n[o].onChange;
            a.call(r, r, u[i])
        }
    }
}(jQuery),
function (e) {
    e.uniform = {
        options: {
            selectClass: "selector",
            radioClass: "radio",
            checkboxClass: "checker",
            fileClass: "uploader",
            filenameClass: "filename",
            fileBtnClass: "action",
            fileDefaultText: "No file selected",
            fileBtnText: "+",
            checkedClass: "checked",
            focusClass: "focus",
            disabledClass: "disabled",
            buttonClass: "button",
            activeClass: "active",
            hoverClass: "hover",
            useID: !0,
            idPrefix: "uniform",
            resetSelector: !1,
            autoHide: !0
        },
        elements: []
    }, e.browser.msie && e.browser.version < 7 ? e.support.selectOpacity = !1 : e.support.selectOpacity = !0, e.fn.uniform = function (t) {
        function r(t) {
            $el = e(t), $el.addClass($el.attr("type")), l(t)
        }

        function i(t) {
            e(t).addClass("uniform"), l(t)
        }

        function s(n) {
            var r = e(n),
                i = e("<div>"),
                s = e("<span>");
            i.addClass(t.buttonClass), t.useID && r.attr("id") != "" && i.attr("id", t.idPrefix + "-" + r.attr("id"));
            var o;
            if (r.is("a") || r.is("button")) o = r.text();
            else if (r.is(":submit") || r.is(":reset") || r.is("input[type=button]")) o = r.attr("value");
            o = o == "" ? r.is(":reset") ? "Reset" : "Submit" : o, s.html(o), r.css("opacity", 0), r.wrap(i), r.wrap(s), i = r.closest("div"), s = r.closest("span"), r.is(":disabled") && i.addClass(t.disabledClass), i.bind({
                "mouseenter.uniform": function () {
                    i.addClass(t.hoverClass)
                },
                "mouseleave.uniform": function () {
                    i.removeClass(t.hoverClass), i.removeClass(t.activeClass)
                },
                "mousedown.uniform touchbegin.uniform": function () {
                    i.addClass(t.activeClass)
                },
                "mouseup.uniform touchend.uniform": function () {
                    i.removeClass(t.activeClass)
                },
                "click.uniform touchend.uniform": function (t) {
                    if (e(t.target).is("span") || e(t.target).is("div"))
                        if (n[0].dispatchEvent) {
                            var r = document.createEvent("MouseEvents");
                            r.initEvent("click", !0, !0), n[0].dispatchEvent(r)
                        } else n[0].click()
                }
            }), n.bind({
                "focus.uniform": function () {
                    i.addClass(t.focusClass)
                },
                "blur.uniform": function () {
                    i.removeClass(t.focusClass)
                }
            }), e.uniform.noSelect(i), l(n)
        }

        function o(n) {
            var r = e(n),
                i = e("<div />"),
                s = e("<span />");
            !r.css("display") == "none" && t.autoHide && i.hide(), i.addClass(t.selectClass), t.useID && n.attr("id") != "" && i.attr("id", t.idPrefix + "-" + n.attr("id"));
            var o = n.find(":selected:first");
            o.length == 0 && (o = n.find("option:first")), s.html(o.html()), n.css("opacity", 0), n.wrap(i), n.before(s), i = n.parent("div"), s = n.siblings("span"), n.bind({
                "change.uniform": function () {
                    s.text(n.find(":selected").html()), i.removeClass(t.activeClass)
                },
                "focus.uniform": function () {
                    i.addClass(t.focusClass)
                },
                "blur.uniform": function () {
                    i.removeClass(t.focusClass), i.removeClass(t.activeClass)
                },
                "mousedown.uniform touchbegin.uniform": function () {
                    i.addClass(t.activeClass)
                },
                "mouseup.uniform touchend.uniform": function () {
                    i.removeClass(t.activeClass)
                },
                "click.uniform touchend.uniform": function () {
                    i.removeClass(t.activeClass)
                },
                "mouseenter.uniform": function () {
                    i.addClass(t.hoverClass)
                },
                "mouseleave.uniform": function () {
                    i.removeClass(t.hoverClass), i.removeClass(t.activeClass)
                },
                "keyup.uniform": function () {
                    s.text(n.find(":selected").html())
                }
            }), e(n).attr("disabled") && i.addClass(t.disabledClass), e.uniform.noSelect(s), l(n)
        }

        function u(n) {
            var r = e(n),
                i = e("<div />"),
                s = e("<span />");
            !r.css("display") == "none" && t.autoHide && i.hide(), i.addClass(t.checkboxClass), t.useID && n.attr("id") != "" && i.attr("id", t.idPrefix + "-" + n.attr("id")), e(n).wrap(i), e(n).wrap(s), s = n.parent(), i = s.parent(), e(n).css("opacity", 0).bind({
                "focus.uniform": function () {
                    i.addClass(t.focusClass)
                },
                "blur.uniform": function () {
                    i.removeClass(t.focusClass)
                },
                "click.uniform touchend.uniform": function () {
                    e(n).attr("checked") ? s.addClass(t.checkedClass) : s.removeClass(t.checkedClass)
                },
                "mousedown.uniform touchbegin.uniform": function () {
                    i.addClass(t.activeClass)
                },
                "mouseup.uniform touchend.uniform": function () {
                    i.removeClass(t.activeClass)
                },
                "mouseenter.uniform": function () {
                    i.addClass(t.hoverClass)
                },
                "mouseleave.uniform": function () {
                    i.removeClass(t.hoverClass), i.removeClass(t.activeClass)
                }
            }), e(n).attr("checked") && s.addClass(t.checkedClass), e(n).attr("disabled") && i.addClass(t.disabledClass), l(n)
        }

        function a(n) {
            var r = e(n),
                i = e("<div />"),
                s = e("<span />");
            !r.css("display") == "none" && t.autoHide && i.hide(), i.addClass(t.radioClass), t.useID && n.attr("id") != "" && i.attr("id", t.idPrefix + "-" + n.attr("id")), e(n).wrap(i), e(n).wrap(s), s = n.parent(), i = s.parent(), e(n).css("opacity", 0).bind({
                "focus.uniform": function () {
                    i.addClass(t.focusClass)
                },
                "blur.uniform": function () {
                    i.removeClass(t.focusClass)
                },
                "click.uniform touchend.uniform": function () {
                    if (!e(n).attr("checked")) s.removeClass(t.checkedClass);
                    else {
                        var r = t.radioClass.split(" ")[0];
                        e("." + r + " span." + t.checkedClass + ":has([name='" + e(n).attr("name") + "'])").removeClass(t.checkedClass), s.addClass(t.checkedClass)
                    }
                },
                "mousedown.uniform touchend.uniform": function () {
                    e(n).is(":disabled") || i.addClass(t.activeClass)
                },
                "mouseup.uniform touchbegin.uniform": function () {
                    i.removeClass(t.activeClass)
                },
                "mouseenter.uniform touchend.uniform": function () {
                    i.addClass(t.hoverClass)
                },
                "mouseleave.uniform": function () {
                    i.removeClass(t.hoverClass), i.removeClass(t.activeClass)
                }
            }), e(n).attr("checked") && s.addClass(t.checkedClass), e(n).attr("disabled") && i.addClass(t.disabledClass), l(n)
        }

        function f(n) {
            var r = e(n),
                i = e("<div />"),
                s = e("<span>" + t.fileDefaultText + "</span>"),
                o = e("<span>" + t.fileBtnText + "</span>");
            !r.css("display") == "none" && t.autoHide && i.hide(), i.addClass(t.fileClass), s.addClass(t.filenameClass), o.addClass(t.fileBtnClass), t.useID && r.attr("id") != "" && i.attr("id", t.idPrefix + "-" + r.attr("id")), r.wrap(i), r.after(o), r.after(s), i = r.closest("div"), s = r.siblings("." + t.filenameClass), o = r.siblings("." + t.fileBtnClass);
            if (!r.attr("size")) {
                var u = i.width();
                r.attr("size", u / 10)
            }
            var a = function () {
                var e = r.val();
                e === "" ? e = t.fileDefaultText : (e = e.split(/[\/\\]+/), e = e[e.length - 1]), s.text(e)
            };
            a(), r.css("opacity", 0).bind({
                "focus.uniform": function () {
                    i.addClass(t.focusClass)
                },
                "blur.uniform": function () {
                    i.removeClass(t.focusClass)
                },
                "mousedown.uniform": function () {
                    e(n).is(":disabled") || i.addClass(t.activeClass)
                },
                "mouseup.uniform": function () {
                    i.removeClass(t.activeClass)
                },
                "mouseenter.uniform": function () {
                    i.addClass(t.hoverClass)
                },
                "mouseleave.uniform": function () {
                    i.removeClass(t.hoverClass), i.removeClass(t.activeClass)
                }
            }), e.browser.msie ? r.bind("click.uniform.ie7", function () {
                setTimeout(a, 0)
            }) : r.bind("change.uniform", a), r.attr("disabled") && i.addClass(t.disabledClass), e.uniform.noSelect(s), e.uniform.noSelect(o), l(n)
        }

        function l(t) {
            t = e(t).get(), t.length > 1 ? e.each(t, function (t, n) {
                e.uniform.elements.push(n)
            }) : e.uniform.elements.push(t)
        }
        t = e.extend(e.uniform.options, t);
        var n = this;
        return t.resetSelector != 0 && e(t.resetSelector).mouseup(function () {
            function t() {
                e.uniform.update(n)
            }
            setTimeout(t, 10)
        }), e.uniform.restore = function (t) {
            t == undefined && (t = e(e.uniform.elements)), e(t).each(function () {
                e(this).is(":checkbox") ? e(this).unwrap().unwrap() : e(this).is("select") ? (e(this).siblings("span").remove(), e(this).unwrap()) : e(this).is(":radio") ? e(this).unwrap().unwrap() : e(this).is(":file") ? (e(this).siblings("span").remove(), e(this).unwrap()) : e(this).is("button, :submit, :reset, a, input[type='button']") && e(this).unwrap().unwrap(), e(this).unbind(".uniform"), e(this).css("opacity", "1");
                var n = e.inArray(e(t), e.uniform.elements);
                e.uniform.elements.splice(n, 1)
            })
        }, e.uniform.noSelect = function (t) {
            function n() {
                return !1
            }
            e(t).each(function () {
                this.onselectstart = this.ondragstart = n, e(this).mousedown(n).css({
                    MozUserSelect: "none"
                })
            })
        }, e.uniform.update = function (n) {
            n == undefined && (n = e(e.uniform.elements)), n = e(n), n.each(function () {
                var r = e(this);
                if (r.is("select")) {
                    var i = r.siblings("span"),
                        s = r.parent("div");
                    s.removeClass(t.hoverClass + " " + t.focusClass + " " + t.activeClass), i.html(r.find(":selected").html()), r.is(":disabled") ? s.addClass(t.disabledClass) : s.removeClass(t.disabledClass)
                } else if (r.is(":checkbox")) {
                    var i = r.closest("span"),
                        s = r.closest("div");
                    s.removeClass(t.hoverClass + " " + t.focusClass + " " + t.activeClass), i.removeClass(t.checkedClass), r.is(":checked") && i.addClass(t.checkedClass), r.is(":disabled") ? s.addClass(t.disabledClass) : s.removeClass(t.disabledClass)
                } else if (r.is(":radio")) {
                    var i = r.closest("span"),
                        s = r.closest("div");
                    s.removeClass(t.hoverClass + " " + t.focusClass + " " + t.activeClass), i.removeClass(t.checkedClass), r.is(":checked") && i.addClass(t.checkedClass), r.is(":disabled") ? s.addClass(t.disabledClass) : s.removeClass(t.disabledClass)
                } else if (r.is(":file")) {
                    var s = r.parent("div"),
                        o = r.siblings(t.filenameClass);
                    btnTag = r.siblings(t.fileBtnClass), s.removeClass(t.hoverClass + " " + t.focusClass + " " + t.activeClass), o.text(r.val()), r.is(":disabled") ? s.addClass(t.disabledClass) : s.removeClass(t.disabledClass)
                } else if (r.is(":submit") || r.is(":reset") || r.is("button") || r.is("a") || n.is("input[type=button]")) {
                    var s = r.closest("div");
                    s.removeClass(t.hoverClass + " " + t.focusClass + " " + t.activeClass), r.is(":disabled") ? s.addClass(t.disabledClass) : s.removeClass(t.disabledClass)
                }
            })
        }, this.each(function () {
            if (
                e.support.selectOpacity) {
                var t = e(this);
                t.is("select") ? t.attr("multiple") != 1 && (t.attr("size") == undefined || t.attr("size") <= 1) && o(t) : t.is(":checkbox") ? u(t) : t.is(":radio") ? a(t) : t.is(":file") ? f(t) : t.is(":text, :password, input[type='email']") ? r(t) : t.is("textarea") ? i(t) : (t.is("a") || t.is(":submit") || t.is(":reset") || t.is("button") || t.is("input[type=button]")) && s(t)
            }
        })
    }
}(jQuery),
function (e) {
    function t(e, t, i, s) {
        var o = e[0],
            u = e.parent(),
            a = /disable|enable/.test(i) ? "disabled" : "checked",
            f = i == "update" ? {
                checked: o.checked,
                disabled: o.disabled
            } : o[a];
        if (/^check|disable/.test(i) && !f) n(e, !0, u, a);
        else if (/uncheck|enable/.test(i) && f) r(e, !0, u, a);
        else if (i == "update")
            for (var a in f) f[a] ? n(e, !1, u, a, s) : r(e, !1, u, a, s);
        else t || (i == 1 && !o.disabled && e.trigger("is.Clicked"), f ? n(e, !0, u, a) : r(e, !0, u, a))
    }

    function n(t, n, i, o, u) {
        n && (t[0][o] = !0), i.data(o) !== !0 && (o == "checked" && t[0].type == "radio" && t[0].name && e("input[name=" + t[0].name + "]").each(function () {
            this !== t[0] && e(this).data("icheck") && r(e(this), !0, e(this).parent(), o)
        }), (n || u) && t.trigger("is.Changed"), n && t.trigger("is." + o.replace("di", "Di").replace("ch", "Ch")), i.data(o, !0).addClass(s(t, o)))
    }

    function r(e, t, n, r, i) {
        var o = r == "disabled" ? "Enabled" : "Unchecked";
        t && (e[0][r] = !1), n.data(r) !== !1 && ((t || i) && e.trigger("is.Changed"), t && e.trigger("is." + o), n.data(r, !1).removeClass(s(e, r)))
    }

    function i(t, n) {
        if (t.data("icheck")) {
            var r = t[0].id,
                i = e("label[for=" + r + "]");
            t.parent().html(t.attr("style", t.data("icheck").style || "").trigger(n || "")), t.removeData("icheck").unbind(".df").unwrap(), r && i.length && i.unbind(".df")
        }
    }

    function s(e, t) {
        if (e.data("icheck")) return e.data("icheck").options[t + "Class"]
    }
    e.fn.iCheck = function (s) {
        if (/^(check|uncheck|disable|enable|update|destroy)$/.test(s)) return this.each(function () {
            /destroy/.test(s) ? i(e(this), "is.Destroyed") : t(e(this), !0, s)
        });
        if (typeof s == "object" || !s) {
            var o = navigator.userAgent,
                u = {
                    checkboxClass: "icheckbox",
                    radioClass: "iradio",
                    checkedClass: "checked",
                    disabledClass: "disabled",
                    hoverClass: "hover",
                    focusClass: "focus",
                    activeClass: "active",
                    labelHover: !0,
                    labelHoverClass: "hover"
                }, a = e.extend({}, u, s),
                f = /^(checkbox|radio)$/.test(a.handle) ? ":" + a.handle : ":checkbox, :radio",
                l = ("" + a.increaseArea).replace("%", "") | 0;
            return l < -50 && (l = -50), this.each(function () {
                var s = e(this).is(f) ? e(this) : e(this).find(f);
                s.each(function () {
                    i(e(this));
                    var s = this,
                        u = s.id,
                        f = {
                            position: "absolute",
                            top: -l + "%",
                            left: -l + "%",
                            display: "block",
                            width: 100 + l * 2 + "%",
                            height: 100 + l * 2 + "%",
                            margin: 0,
                            padding: 0,
                            background: "#fff",
                            border: 0,
                            opacity: 0
                        }, c = /ipad|iphone|ipod|android|blackberry|windows phone|opera mini/i.test(o) ? {
                            position: "absolute",
                            visibility: "hidden"
                        } : l | 0 ? f : {
                            position: "absolute",
                            opacity: 0
                        }, h = s.type == "checkbox" ? a.checkboxClass : a.radioClass,
                        p = e(this).data("icheck", {
                            style: e(this).attr("style"),
                            options: a
                        }).css(c),
                        d = e("label[for=" + u + "]"),
                        v = p.wrap('<div class="' + h + '"/>').trigger("is.Created").parent().append(a.insert),
                        m = e("<ins/>").css(f).appendTo(v).click(function () {
                            p.click(), t(p, !1, !0)
                        }),
                        g = a.hoverClass,
                        y = a.labelHoverClass,
                        b;
                    a.cursor == 1 && m.css("cursor", "pointer"), a.inheritClass == 1 && v.addClass(s.className), a.inheritID == 1 && u && v.attr("id", "icheck-" + u), v.css("position") == "static" && v.css("position", "relative"), t(p, !0, "update"), u && d.length && d.bind("click.df mouseenter.df mouseleave.df touchbegin.df touchend.df", function (n) {
                        var r = n.type,
                            i = e(this);
                        r == "click" ? (n.preventDefault(), p.click(), t(p, !1, !0)) : a.labelHover == 1 && !s.disabled && (/mouseenter|touchbegin/.test(r) ? (v.addClass(g), i.addClass(y)) : (v.removeClass(g), i.removeClass(y)))
                    }), p.bind("focus.df blur.df keyup.df keydown.df keypress.df", function (e) {
                        var i = e.type,
                            u = e.keyCode || e.charCode || e.which,
                            f = /MSIE [5-8]/.test(o) ? i == "keyup" && b !== "keypress" : i == "keyup",
                            l = i == "keypress" && u == 32;
                        /focus|blur/.test(i) ? i == "focus" ? v.addClass(a.focusClass) : v.removeClass(a.focusClass) : s.type == "radio" ? (f ? t(p, !0, "update", !0) : l && !s.checked && n(p, !1, v, "checked", !0), b = i) : s.type == "checkbox" && l && (s.checked ? r(p, !1, v, "checked", !0) : n(p, !1, v, "checked", !0))
                    }), m.bind("mousedown mouseup mouseout mouseenter mouseleave touchbegin touchend", function (e) {
                        var t = e.type,
                            n = /mousedown|mouseup|mouseout/.test(t) ? a.activeClass : g;
                        if (s.disabled) return;
                        /mousedown|mouseenter|touchbegin/.test(t) ? v.addClass(n) : v.removeClass(n), u && d.length && a.labelHover == 1 && n == g && (/mouseleave|touchend/.test(t) ? d.removeClass(y) : d.addClass(y))
                    })
                })
            })
        }
        return this
    }
}(jQuery),
function (e, t, n) {
    var r = e();
    e.fn.dropdownHover = function (n) {
        return r = r.add(this.parent()), this.each(function () {
            var n = e(this).parent(),
                i = {
                    delay: 500,
                    instantlyCloseOthers: !0
                }, s = {
                    delay: e(this).data("delay"),
                    instantlyCloseOthers: e(this).data("close-others")
                }, o = e.extend(!0, {}, i, o, s),
                u;
            n.hover(function () {
                o.instantlyCloseOthers === !0 && r.removeClass("open"), t.clearTimeout(u), e(this).addClass("open")
            }, function () {
                u = t.setTimeout(function () {
                    n.removeClass("open")
                }, o.delay)
            })
        })
    }, e('[data-hover="dropdown"]').dropdownHover()
}(jQuery, this),
function (e) {
    typeof e.fn.each2 == "undefined" && e.fn.extend({
        each2: function (t) {
            var n = e([0]),
                r = -1,
                i = this.length;
            while (++r < i && (n.context = n[0] = this[r]) && t.call(n[0], r, n) !== !1);
            return this
        }
    })
}(jQuery),
function (e, t) {
    "use strict";

    function l(e, t) {
        var n = 0,
            r = t.length;
        for (; n < r; n += 1)
            if (e === t[n]) return n;
        return -1
    }

    function c(e, t) {
        return e === t
    }

    function h(t, n) {
        var r, i, s;
        if (t === null || t.length < 1) return [];
        r = t.split(n);
        for (i = 0, s = r.length; i < s; i += 1) r[i] = e.trim(r[i]);
        return r
    }

    function p(e) {
        return e.outerWidth(!1) - e.width()
    }

    function d(n) {
        var r = "keyup-change-value";
        n.bind("keydown", function () {
            e.data(n, r) === t && e.data(n, r, n.val())
        }), n.bind("keyup", function () {
            var i = e.data(n, r);
            i !== t && n.val() !== i && (e.removeData(n, r), n.trigger("keyup-change"))
        })
    }

    function v(n) {
        n.bind("mousemove", function (n) {
            var r = a;
            (r === t || r.x !== n.pageX || r.y !== n.pageY) && e(n.target).trigger("mousemove-filtered", n)
        })
    }

    function m(e, n, r) {
        r = r || t;
        var i;
        return function () {
            var t = arguments;
            window.clearTimeout(i), i = window.setTimeout(function () {
                n.apply(r, t)
            }, e)
        }
    }

    function g(e) {
        var t = !1,
            n;
        return function () {
            return t === !1 && (n = e(), t = !0), n
        }
    }

    function y(e, t) {
        var n = m(e, function (e) {
            t.trigger("scroll-debounced", e)
        });
        t.bind("scroll", function (e) {
            l(e.target, t.get()) >= 0 && n(e)
        })
    }

    function b(e) {
        if (e[0] === document.activeElement) return;
        window.setTimeout(function () {
            var t = e[0],
                n = e.val().length,
                r;
            e.focus(), t.setSelectionRange ? t.setSelectionRange(n, n) : t.createTextRange && (r = t.createTextRange(), r.collapse(!0), r.moveEnd("character", n), r.moveStart("character", n), r.select())
        }, 0)
    }

    function w(e) {
        e.preventDefault(), e.stopPropagation()
    }

    function E(e) {
        e.preventDefault(), e.stopImmediatePropagation()
    }

    function S(t) {
        if (!u) {
            var n = t[0].currentStyle || window.getComputedStyle(t[0], null);
            u = e(document.createElement("div")).css({
                position: "absolute",
                left: "-10000px",
                top: "-10000px",
                display: "none",
                fontSize: n.fontSize,
                fontFamily: n.fontFamily,
                fontStyle: n.fontStyle,
                fontWeight: n.fontWeight,
                letterSpacing: n.letterSpacing,
                textTransform: n.textTransform,
                whiteSpace: "nowrap"
            }), u.attr("class", "select2-sizer"), e("body").append(u)
        }
        return u.text(t.val()), u.width()
    }

    function x(t, n, r) {
        var i, s = [],
            o;
        i = t.attr("class"), typeof i == "string" && e(i.split(" ")).each2(function () {
            this.indexOf("select2-") === 0 && s.push(this)
        }), i = n.attr("class"), typeof i == "string" && e(i.split(" ")).each2(function () {
            this.indexOf("select2-") !== 0 && (o = r(this), typeof o == "string" && o.length > 0 && s.push(this))
        }), t.attr("class", s.join(" "))
    }

    function T(e, t, n, r) {
        var i = e.toUpperCase().indexOf(t.toUpperCase()),
            s = t.length;
        if (i < 0) {
            n.push(r(e));
            return
        }
        n.push(r(e.substring(0, i))), n.push("<span class='select2-match'>"), n.push(r(e.substring(i, i + s))), n.push("</span>"), n.push(r(e.substring(i + s, e.length)))
    }

    function N(t) {
        var n, r = 0,
            i = null,
            s = t.quietMillis || 100;
        return function (o) {
            window.clearTimeout(n), n = window.setTimeout(function () {
                r += 1;
                var n = r,
                    s = t.data,
                    u = t.url,
                    a = t.transport || e.ajax,
                    f = t.type || "GET",
                    l = {};
                s = s ? s.call(this, o.term, o.page, o.context) : null, u = typeof u == "function" ? u.call(this, o.term, o.page, o.context) : u, null !== i && i.abort(), t.params && (e.isFunction(t.params) ? e.extend(l, t.params.call(null)) : e.extend(l, t.params)), e.extend(l, {
                    url: u,
                    dataType: t.dataType,
                    data: s,
                    type: f,
                    cache: !1,
                    success: function (e) {
                        if (n < r) return;
                        var i = t.results(e, o.page);
                        o.callback(i)
                    }
                }), i = a.call(null, l)
            }, s)
        }
    }

    function C(t) {
        var n = t,
            r, i = function (e) {
                return "" + e.text
            };
        return e.isArray(n) || (i = n.text, e.isFunction(i) || (r = n.text, i = function (e) {
            return e[r]
        }), n = n.results),
        function (t) {
            var r = t.term,
                s = {
                    results: []
                }, o;
            if (r === "") {
                t.callback({
                    results: n
                });
                return
            }
            o = function (n, s) {
                var u, a;
                n = n[0];
                if (n.children) {
                    u = {};
                    for (a in n) n.hasOwnProperty(a) && (u[a] = n[a]);
                    u.children = [], e(n.children).each2(function (e, t) {
                        o(t, u.children)
                    }), (u.children.length || t.matcher(r, i(u), n)) && s.push(u)
                } else t.matcher(r, i(n), n) && s.push(n)
            }, e(n).each2(function (e, t) {
                o(t, s.results)
            }), t.callback(s)
        }
    }

    function k(n) {
        var r = e.isFunction(n);
        return function (i) {
            var s = i.term,
                o = {
                    results: []
                };
            e(r ? n() : n).each(function () {
                var e = this.text !== t,
                    n = e ? this.text : this;
                (s === "" || i.matcher(s, n)) && o.results.push(e ? this : {
                        id: this,
                        text: this
                    })
            }), i.callback(o)
        }
    }

    function L(t, n) {
        if (e.isFunction(t)) return !0;
        if (!t) return !1;
        throw new Error("formatterName must be a function or a falsy value")
    }

    function A(t) {
        return e.isFunction(t) ? t() : t
    }

    function O(t) {
        var n = 0;
        return e.each(t, function (e, t) {
            t.children ? n += O(t.children) : n++
        }), n
    }

    function M(e, n, r, i) {
        var s = e,
            o = !1,
            u, a, f, l, h;
        if (!i.createSearchChoice || !i.tokenSeparators || i.tokenSeparators.length < 1) return t;
        for (;;) {
            a = -1;
            for (f = 0, l = i.tokenSeparators.length; f < l; f++) {
                h = i.tokenSeparators[f], a = e.indexOf(h);
                if (a >= 0) break
            }
            if (a < 0) break;
            u = e.substring(0, a), e = e.substring(a + h.length);
            if (u.length > 0) {
                u = i.createSearchChoice(u, n);
                if (u !== t && u !== null && i.id(u) !== t && i.id(u) !== null) {
                    o = !1;
                    for (f = 0, l = n.length; f < l; f++)
                        if (c(i.id(u), i.id(n[f]))) {
                            o = !0;
                            break
                        }
                    o || r(u)
                }
            }
        }
        if (s !== e) return e
    }

    function _(t, n) {
        var r = function () {};
        return r.prototype = new t, r.prototype.constructor = r, r.prototype.parent = t.prototype, r.prototype = e.extend(r.prototype, n), r
    }
    if (window.Select2 !== t) return;
    var n, r, i, s, o, u, a, f;
    n = {
        TAB: 9,
        ENTER: 13,
        ESC: 27,
        SPACE: 32,
        LEFT: 37,
        UP: 38,
        RIGHT: 39,
        DOWN: 40,
        SHIFT: 16,
        CTRL: 17,
        ALT: 18,
        PAGE_UP: 33,
        PAGE_DOWN: 34,
        HOME: 36,
        END: 35,
        BACKSPACE: 8,
        DELETE: 46,
        isArrow: function (e) {
            e = e.which ? e.which : e;
            switch (e) {
            case n.LEFT:
            case n.RIGHT:
            case n.UP:
            case n.DOWN:
                return !0
            }
            return !1
        },
        isControl: function (e) {
            var t = e.which;
            switch (t) {
            case n.SHIFT:
            case n.CTRL:
            case n.ALT:
                return !0
            }
            return e.metaKey ? !0 : !1
        },
        isFunctionKey: function (e) {
            return e = e.which ? e.which : e, e >= 112 && e <= 123
        }
    }, f = e(document), o = function () {
        var e = 1;
        return function () {
            return e++
        }
    }(), f.bind("mousemove", function (e) {
        a = {
            x: e.pageX,
            y: e.pageY
        }
    }), r = _(Object, {
        bind: function (e) {
            var t = this;
            return function () {
                e.apply(t, arguments)
            }
        },
        init: function (n) {
            var r, i, s = ".select2-results",
                u;
            this.opts = n = this.prepareOpts(n), this.id = n.id, n.element.data("select2") !== t && n.element.data("select2") !== null && this.destroy(), this.enabled = !0, this.container = this.createContainer(), this.containerId = "s2id_" + (n.element.attr("id") || "autogen" + o()), this.containerSelector = "#" + this.containerId.replace(/([;&,\.\+\*\~':"\!\^#$%@\[\]\(\)=>\|])/g, "\\$1"), this.container.attr("id", this.containerId), this.body = g(function () {
                return n.element.closest("body")
            }), u = e("#select2-drop-mask"), u.length == 0 && (u = e(document.createElement("div")), u.attr("id", "select2-drop-mask").attr("class", "select2-drop-mask"), u.hide(), u.appendTo(this.body()), u.bind("mousedown touchstart", function (t) {
                var n = e("#select2-drop"),
                    r;
                n.length > 0 && (r = n.data("select2"), r.opts.selectOnBlur && r.selectHighlighted({
                    noFocus: !0
                }), r.close())
            })), x(this.container, this.opts.element, this.opts.adaptContainerCssClass), this.container.css(A(n.containerCss)), this.container.addClass(A(n.containerCssClass)), this.elementTabIndex = this.opts.element.attr("tabIndex"), this.opts.element.data("select2", this).addClass("select2-offscreen").bind("focus.select2", function () {
                e(this).select2("focus")
            }).attr("tabIndex", "-1").before(this.container), this.container.data("select2", this), this.dropdown = this.container.find(".select2-drop"), this.dropdown.addClass(A(n.dropdownCssClass)), this.dropdown.data("select2", this), this.results = r = this.container.find(s), this.search = i = this.container.find("input.select2-input"), i.attr("tabIndex", this.elementTabIndex), this.resultsPage = 0, this.context = null, this.initContainer(), this.initContainerWidth(), v(this.results), this.dropdown.delegate(s, "mousemove-filtered", this.bind(this.highlightUnderEvent)), y(80, this.results), this.dropdown.delegate(s, "scroll-debounced", this.bind(this.loadMoreIfNeeded)), e.fn.mousewheel && r.mousewheel(function (e, t, n, i) {
                var s = r.scrollTop(),
                    o;
                i > 0 && s - i <= 0 ? (r.scrollTop(0), w(e)) : i < 0 && r.get(0).scrollHeight - r.scrollTop() + i <= r.height() && (r.scrollTop(r.get(0).scrollHeight - r.height()), w(e))
            }), d(i), i.bind("keyup-change input paste", this.bind(this.updateResults)), i.bind("focus", function () {
                i.addClass("select2-focused")
            }), i.bind("blur", function () {
                i.removeClass("select2-focused")
            }), this.dropdown.delegate(s, "mouseup", this.bind(function (t) {
                e(t.target).closest(".select2-result-selectable").length > 0 ? (this.highlightUnderEvent(t), this.selectHighlighted(t)) : this.focusSearch(), w(t)
            })), this.dropdown.bind("click mouseup mousedown", function (e) {
                e.stopPropagation()
            }), e.isFunction(this.opts.initSelection) && (this.initSelection(), this.monitorSource()), (n.element.is(":disabled") || n.element.is("[readonly='readonly']")) && this.disable()
        },
        destroy: function () {
            var e = this.opts.element.data("select2");
            this.propertyObserver && (delete this.propertyObserver, this.propertyObserver = null), e !== t && (e.container.remove(), e.dropdown.remove(), e.opts.element.removeClass("select2-offscreen").removeData("select2").unbind(".select2").attr({
                tabIndex: this.elementTabIndex
            }).show())
        },
        prepareOpts: function (n) {
            var r, i, s, o;
            r = n.element, r.get(0).tagName.toLowerCase() === "select" && (this.select = i = n.element), i && e.each(["id", "multiple", "ajax", "query", "createSearchChoice", "initSelection", "data", "tags"], function () {
                if (this in n) throw new Error("Option '" + this + "' is not allowed for Select2 when attached to a <select> element.")
            }), n = e.extend({}, {
                populateResults: function (r, i, s) {
                    var o, u, a, f, l = this.opts.id,
                        c = this;
                    o = function (r, i, u) {
                        var a, f, h, p, d, v, m, g, y, b;
                        r = n.sortResults(r, i, s);
                        for (a = 0, f = r.length; a < f; a += 1) h = r[a], d = h.disabled === !0, p = !d && l(h) !== t, v = h.children && h.children.length > 0, m = e("<li></li>"), m.addClass("select2-results-dept-" + u), m.addClass("select2-result"), m.addClass(p ? "select2-result-selectable" : "select2-result-unselectable"), d && m.addClass("select2-disabled"), v && m.addClass("select2-result-with-children"), m.addClass(c.opts.formatResultCssClass(h)), g = e(document.createElement("div")), g.addClass("select2-result-label"), b = n.formatResult(h, g, s, c.opts.escapeMarkup), b !== t && g.html(b), m.append(g), v && (y = e("<ul></ul>"), y.addClass("select2-result-sub"), o(h.children, y, u + 1), m.append(y)), m.data("select2-data", h), i.append(m)
                    }, o(i, r, 0)
                }
            }, e.fn.select2.defaults, n), typeof n.id != "function" && (s = n.id, n.id = function (e) {
                return e[s]
            });
            if (e.isArray(n.element.data("select2Tags"))) {
                if ("tags" in n) throw "tags specified as both an attribute 'data-select2-tags' and in options of Select2 " + n.element.attr("id");
                n.tags = n.element.attr("data-select2-tags")
            }
            i ? (n.query = this.bind(function (n) {
                var i = {
                    results: [],
                    more: !1
                }, s = n.term,
                    o, u, a;
                a = function (e, t) {
                    var r;
                    e.is("option") ? n.matcher(s, e.text(), e) && t.push({
                        id: e.attr("value"),
                        text: e.text(),
                        element: e.get(),
                        css: e.attr("class"),
                        disabled: c(e.attr("disabled"), "disabled")
                    }) : e.is("optgroup") && (r = {
                        text: e.attr("label"),
                        children: [],
                        element: e.get(),
                        css: e.attr("class")
                    }, e.children().each2(function (e, t) {
                        a(t, r.children)
                    }), r.children.length > 0 && t.push(r))
                }, o = r.children(), this.getPlaceholder() !== t && o.length > 0 && (u = o[0], e(u).text() === "" && (o = o.not(u))), o.each2(function (e, t) {
                    a(t, i.results)
                }), n.callback(i)
            }), n.id = function (e) {
                return e.id
            }, n.formatResultCssClass = function (e) {
                return e.css
            }) : "query" in n || ("ajax" in n ? (o = n.element.data("ajax-url"), o && o.length > 0 && (n.ajax.url = o), n.query = N(n.ajax)) : "data" in n ? n.query = C(n.data) : "tags" in n && (n.query = k(n.tags), n.createSearchChoice === t && (n.createSearchChoice = function (e) {
                return {
                    id: e,
                    text: e
                }
            }), n.initSelection === t && (n.initSelection = function (t, r) {
                var i = [];
                e(h(t.val(), n.separator)).each(function () {
                    var t = this,
                        r = this,
                        s = n.tags;
                    e.isFunction(s) && (s = s()), e(s).each(function () {
                        if (c(this.id, t)) return r = this.text, !1
                    }), i.push({
                        id: t,
                        text: r
                    })
                }), r(i)
            })));
            if (typeof n.query != "function") throw "query function not defined for Select2 " + n.element.attr("id");
            return n
        },
        monitorSource: function () {
            var e = this.opts.element,
                t;
            e.bind("change.select2", this.bind(function (e) {
                this.opts.element.data("select2-change-triggered") !== !0 && this.initSelection()
            })), t = this.bind(function () {
                var e, t, n = this;
                e = this.opts.element.attr("disabled") !== "disabled", t = this.opts.element.attr("readonly") === "readonly", e = e && !t, this.enabled !== e && (e ? this.enable() : this.disable()), x(this.container, this.opts.element, this.opts.adaptContainerCssClass), this.container.addClass(A(this.opts.containerCssClass)), x(this.dropdown, this.opts.element, this.opts.adaptDropdownCssClass), this.dropdown.addClass(A(this.opts.dropdownCssClass))
            }), e.bind("propertychange.select2 DOMAttrModified.select2", t), typeof WebKitMutationObserver != "undefined" && (this.propertyObserver && (delete this.propertyObserver, this.propertyObserver = null), this.propertyObserver = new WebKitMutationObserver(function (e) {
                e.forEach(t)
            }), this.propertyObserver.observe(e.get(0), {
                attributes: !0,
                subtree: !1
            }))
        },
        triggerChange: function (t) {
            t = t || {}, t = e.extend({}, t, {
                type: "change",
                val: this.val()
            }), this.opts.element.data("select2-change-triggered", !0), this.opts.element.trigger(t), this.opts.element.data("select2-change-triggered", !1), this.opts.element.click(), this.opts.blurOnChange && this.opts.element.blur()
        },
        enable: function () {
            if (this.enabled) return;
            this.enabled = !0, this.container.removeClass("select2-container-disabled"), this.opts.element.removeAttr("disabled")
        },
        disable: function () {
            if (!this.enabled) return;
            this.close(), this.enabled = !1, this.container.addClass("select2-container-disabled"), this.opts.element.attr("disabled", "disabled")
        },
        opened: function () {
            return this.container.hasClass("select2-dropdown-open")
        },
        positionDropdown: function () {
            var t = this.container.offset(),
                n = this.container.outerHeight(!1),
                r = this.container.outerWidth(!1),
                i = this.dropdown.outerHeight(!1),
                s = e(window).scrollLeft() + e(window).width(),
                o = e(window).scrollTop() + e(window).height(),
                u = t.top + n,
                a = t.left,
                f = u + i <= o,
                l = t.top - i >= this.body().scrollTop(),
                c = this.dropdown.outerWidth(!1),
                h = a + c <= s,
                p = this.dropdown.hasClass("select2-drop-above"),
                d, v, m;
            this.body().css("position") !== "static" && (d = this.body().offset(), u -= d.top, a -= d.left), p ? (v = !0, !l && f && (v = !1)) : (v = !1, !f && l && (v = !0)), h || (a = t.left + r - c), v ? (u = t.top - i, this.container.addClass("select2-drop-above"), this.dropdown.addClass("select2-drop-above")) : (this.container.removeClass("select2-drop-above"), this.dropdown.removeClass("select2-drop-above")), m = e.extend({
                top: u,
                left: a,
                width: r
            }, A(this.opts.dropdownCss)), this.dropdown.css(m)
        },
        shouldOpen: function () {
            var t;
            return this.opened() ? !1 : (t = e.Event("opening"), this.opts.element.trigger(t), !t.isDefaultPrevented())
        },
        clearDropdownAlignmentPreference: function () {
            this.container.removeClass("select2-drop-above"), this.dropdown.removeClass("select2-drop-above")
        },
        open: function () {
            return this.shouldOpen() ? (window.setTimeout(this.bind(this.opening), 1), !0) : !1
        },
        opening: function () {
            var t = this.containerId,
                n = "scroll." + t,
                r = "resize." + t,
                i = "orientationchange." + t,
                s;
            this.clearDropdownAlignmentPreference(), this.container.addClass("select2-dropdown-open").addClass("select2-container-active"), this.dropdown[0] !== this.body().children().last()[0] && this.dropdown.detach().appendTo(this.body()), this.updateResults(!0), s = e("#select2-drop-mask"), this.dropdown.prev()[0] !== s[0] && this.dropdown.before(s), e("#select2-drop").removeAttr("id"), this.dropdown.attr("id", "select2-drop"), s.css({
                width: document.documentElement.scrollWidth,
                height: document.documentElement.scrollHeight
            }), s.show(), this.dropdown.show(), this.positionDropdown(), this.dropdown.addClass("select2-drop-active"), this.ensureHighlightVisible(), this.container.parents().add(window).each(function () {
                e(this).bind(r + " " + n + " " + i, function (t) {
                    e("#select2-drop-mask").css({
                        width: document.documentElement.scrollWidth,
                        height: document.documentElement.scrollHeight
                    }), e("#select2-drop").data("select2").positionDropdown()
                })
            }), this.focusSearch()
        },
        close: function () {
            if (!this.opened()) return;
            var t = this.containerId,
                n = "scroll." + t,
                r = "resize." + t,
                i = "orientationchange." + t;
            this.container.parents().add(window).each(function () {
                e(this).unbind(n).unbind(r).unbind(i)
            }), this.clearDropdownAlignmentPreference(), e("#select2-drop-mask").hide(), this.dropdown.removeAttr("id"), this.dropdown.hide(), this.container.removeClass("select2-dropdown-open"), this.results.empty(), this.clearSearch(), this.opts.element.trigger(e.Event("close"))
        },
        clearSearch: function () {},
        getMaximumSelectionSize: function () {
            return A(this.opts.maximumSelectionSize)
        },
        ensureHighlightVisible: function () {
            var t = this.results,
                n, r, i, s, o, u, a;
            r = this.highlight();
            if (r < 0) return;
            if (r == 0) {
                t.scrollTop(0);
                return
            }
            n = this.findHighlightableChoices(), i = e(n[r]), s = i.offset().top + i.outerHeight(!0), r === n.length - 1 && (a = t.find("li.select2-more-results"), a.length > 0 && (s = a.offset().top + a.outerHeight(!0))), o = t.offset().top + t.outerHeight(!0), s > o && t.scrollTop(t.scrollTop() + (s - o)), u = i.offset().top - t.offset().top, u < 0 && i.css("display") != "none" && t.scrollTop(t.scrollTop() + u)
        },
        findHighlightableChoices: function () {
            var e = this.results.find(".select2-result-selectable:not(.select2-selected):not(.select2-disabled)");
            return this.results.find(".select2-result-selectable:not(.select2-selected):not(.select2-disabled)")
        },
        moveHighlight: function (t) {
            var n = this.findHighlightableChoices(),
                r = this.highlight();
            while (r > -1 && r < n.length) {
                r += t;
                var i = e(n[r]);
                if (i.hasClass("select2-result-selectable") && !i.hasClass("select2-disabled") && !i.hasClass("select2-selected")) {
                    this.highlight(r);
                    break
                }
            }
        },
        highlight: function (t) {
            var n = this.findHighlightableChoices(),
                r, i;
            if (arguments.length === 0) return l(n.filter(".select2-highlighted")[0], n.get());
            t >= n.length && (t = n.length - 1), t < 0 && (t = 0), this.results.find(".select2-highlighted").removeClass("select2-highlighted"), r = e(n[t]), r.addClass("select2-highlighted"), this.ensureHighlightVisible(), i = r.data("select2-data"), i && this.opts.element.trigger({
                type: "highlight",
                val: this.id(i),
                choice: i
            })
        },
        countSelectableResults: function () {
            return this.findHighlightableChoices().length
        },
        highlightUnderEvent: function (t) {
            var n = e(t.target).closest(".select2-result-selectable");
            if (n.length > 0 && !n.is(".select2-highlighted")) {
                var r = this.findHighlightableChoices();
                this.highlight(r.index(n))
            } else n.length == 0 && this.results.find(".select2-highlighted").removeClass("select2-highlighted")
        },
        loadMoreIfNeeded: function () {
            var e = this.results,
                t = e.find("li.select2-more-results"),
                n, r = -1,
                i = this.resultsPage + 1,
                s = this,
                o = this.search.val(),
                u = this.context;
            if (t.length === 0) return;
            n = t.offset().top - e.offset().top - e.height(), n <= this.opts.loadMorePadding && (t.addClass("select2-active"), this.opts.query({
                element: this.opts.element,
                term: o,
                page: i,
                context: u,
                matcher: this.opts.matcher,
                callback: this.bind(function (n) {
                    if (!s.opened()) return;
                    s.opts.populateResults.call(this, e, n.results, {
                        term: o,
                        page: i,
                        context: u
                    }), n.more === !0 ? (t.detach().appendTo(e).text(s.opts.formatLoadMore(i + 1)), window.setTimeout(function () {
                        s.loadMoreIfNeeded()
                    }, 10)) : t.remove(), s.positionDropdown(), s.resultsPage = i, s.context = n.context
                })
            }))
        },
        tokenize: function () {},
        updateResults: function (n) {
            function f() {
                i.scrollTop(0), r.removeClass("select2-active"), u.positionDropdown()
            }

            function l(e) {
                i.html(e), f()
            }
            var r = this.search,
                i = this.results,
                s = this.opts,
                o, u = this,
                a;
            if (n !== !0 && (this.showSearchInput === !1 || !this.opened())) return;
            r.addClass("select2-active");
            var h = this.getMaximumSelectionSize();
            if (h >= 1) {
                o = this.data();
                if (e.isArray(o) && o.length >= h && L(s.formatSelectionTooBig, "formatSelectionTooBig")) {
                    l("<li class='select2-selection-limit'>" + s.formatSelectionTooBig(h) + "</li>");
                    return
                }
            }
            if (r.val().length < s.minimumInputLength) {
                L(s.formatInputTooShort, "formatInputTooShort") ? l("<li class='select2-no-results'>" + s.formatInputTooShort(r.val(), s.minimumInputLength) + "</li>") : l("");
                return
            }
            s.formatSearching() && n === !0 && l("<li class='select2-searching'>" + s.formatSearching() + "</li>");
            if (s.maximumInputLength && r.val().length > s.maximumInputLength) {
                L(s.formatInputTooLong, "formatInputTooLong") ? l("<li class='select2-no-results'>" + s.formatInputTooLong(r.val(), s.maximumInputLength) + "</li>") : l("");
                return
            }
            a = this.tokenize(), a != t && a != null && r.val(a), this.resultsPage = 1, s.query({
                element: s.element,
                term: r.val(),
                page: this.resultsPage,
                context: null,
                matcher: s.matcher,
                callback: this.bind(function (o) {
                    var a;
                    if (!this.opened()) return;
                    this.context = o.context === t ? null : o.context, this.opts.createSearchChoice && r.val() !== "" && (a = this.opts.createSearchChoice.call(null, r.val(), o.results), a !== t && a !== null && u.id(a) !== t && u.id(a) !== null && e(o.results).filter(function () {
                        return c(u.id(this), u.id(a))
                    }).length === 0 && o.results.unshift(a));
                    if (o.results.length === 0 && L(s.formatNoMatches, "formatNoMatches")) {
                        l("<li class='select2-no-results'>" + s.formatNoMatches(r.val()) + "</li>");
                        return
                    }
                    i.empty(), u.opts.populateResults.call(this, i, o.results, {
                        term: r.val(),
                        page: this.resultsPage,
                        context: null
                    }), o.more === !0 && L(s.formatLoadMore, "formatLoadMore") && (i.append("<li class='select2-more-results'>" + u.opts.escapeMarkup(s.formatLoadMore(this.resultsPage)) + "</li>"), window.setTimeout(function () {
                        u.loadMoreIfNeeded()
                    }, 10)), this.postprocessResults(o, n), f()
                })
            })
        },
        cancel: function () {
            this.close()
        },
        blur: function () {
            this.opts.selectOnBlur && this.selectHighlighted({
                noFocus: !0
            }), this.close(), this.container.removeClass("select2-container-active"), this.search[0] === document.activeElement && this.search.blur(), this.clearSearch(), this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus")
        },
        focusSearch: function () {
            b(this.search)
        },
        selectHighlighted: function (e) {
            var t = this.highlight(),
                n = this.results.find(".select2-highlighted"),
                r = n.closest(".select2-result").data("select2-data");
            r && (this.highlight(t), this.onSelect(r, e))
        },
        getPlaceholder: function () {
            return this.select && this.select.find("option").first().text() !== "" ? t : this.opts.element.attr("placeholder") || this.opts.element.attr("data-placeholder") || this.opts.element.data("placeholder") || this.opts.placeholder
        },
        initContainerWidth: function () {
            function n() {
                var n, r, i, s, o;
                if (this.opts.width === "off") return null;
                if (this.opts.width === "element") return this.opts.element.outerWidth(!1) === 0 ? "auto" : this.opts.element.outerWidth(!1) + "px";
                if (this.opts.width === "copy" || this.opts.width === "resolve") {
                    n = this.opts.element.attr("style");
                    if (n !== t) {
                        r = n.split(";");
                        for (s = 0, o = r.length; s < o; s += 1) {
                            i = r[s].replace(/\s/g, "").match(/width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/);
                            if (i !== null && i.length >= 1) return i[1]
                        }
                    }
                    return this.opts.width === "resolve" ? (n = this.opts.element.css("width"), n.indexOf("%") > 0 ? n : this.opts.element.outerWidth(!1) === 0 ? "auto" : this.opts.element.outerWidth(!1) + "px") : null
                }
                return e.isFunction(this.opts.width) ? this.opts.width() : this.opts.width
            }
            var r = n.call(this);
            r !== null && this.container.css("width", r)
        }
    }), i = _(r, {
        createContainer: function () {
            var t = e(document.createElement("div")).attr({
                "class": "select2-container"
            }).html(["<a href='javascript:void(0)' onclick='return false;' class='select2-choice' tabindex='-1'>", "   <span></span><abbr class='select2-search-choice-close' style='display:none;'></abbr>", "   <div><b></b></div>", "</a>", "<input class='select2-focusser select2-offscreen' type='text'/>", "<div class='select2-drop' style='display:none'>", "   <div class='select2-search'>", "       <input type='text' autocomplete='off' class='select2-input'/>", "   </div>", "   <ul class='select2-results'>", "   </ul>", "</div>"].join(""));
            return t
        },
        disable: function () {
            if (!this.enabled) return;
            this.parent.disable.apply(this, arguments), this.focusser.attr("disabled", "disabled")
        },
        enable: function () {
            if (this.enabled) return;
            this.parent.enable.apply(this, arguments), this.focusser.removeAttr("disabled")
        },
        opening: function () {
            this.parent.opening.apply(this, arguments), this.focusser.attr("disabled", "disabled"), this.opts.element.trigger(e.Event("open"))
        },
        close: function () {
            if (!this.opened()) return;
            this.parent.close.apply(this, arguments), this.focusser.removeAttr("disabled"), b(this.focusser)
        },
        focus: function () {
            this.opened() ? this.close() : (this.focusser.removeAttr("disabled"), this.focusser.focus())
        },
        isFocused: function () {
            return this.container.hasClass("select2-container-active")
        },
        cancel: function () {
            this.parent.cancel.apply(this, arguments), this.focusser.removeAttr("disabled"), this.focusser.focus()
        },
        initContainer: function () {
            var e, t = this.container,
                r = this.dropdown,
                i = !1;
            this.selection = e = t.find(".select2-choice"), this.focusser = t.find(".select2-focusser"), this.search.bind("keydown", this.bind(function (e) {
                if (!this.enabled) return;
                if (e.which === n.PAGE_UP || e.which === n.PAGE_DOWN) {
                    w(e);
                    return
                }
                switch (e.which) {
                case n.UP:
                case n.DOWN:
                    this.moveHighlight(e.which === n.UP ? -1 : 1), w(e);
                    return;
                case n.TAB:
                case n.ENTER:
                    this.selectHighlighted(), w(e);
                    return;
                case n.ESC:
                    this.cancel(e), w(e);
                    return
                }
            })), this.focusser.bind("keydown", this.bind(function (e) {
                if (!this.enabled) return;
                if (e.which === n.TAB || n.isControl(e) || n.isFunctionKey(e) || e.which === n.ESC) return;
                if (this.opts.openOnEnter === !1 && e.which === n.ENTER) {
                    w(e);
                    return
                }
                if (e.which == n.DOWN || e.which == n.UP || e.which == n.ENTER && this.opts.openOnEnter) {
                    this.open(), w(e);
                    return
                }
                if (e.which == n.DELETE || e.which == n.BACKSPACE) {
                    this.opts.allowClear && this.clear(), w(e);
                    return
                }
            })), d(this.focusser), this.focusser.bind("keyup-change input", this.bind(function (e) {
                if (this.opened()) return;
                this.open(), this.search.val(this.focusser.val()), this.focusser.val(""), w(e)
            })), e.delegate("abbr", "mousedown", this.bind(function (e) {
                if (!this.enabled) return;
                this.clear(), E(e), this.close(), this.triggerChange(), this.selection.focus()
            })), e.bind("mousedown", this.bind(function (e) {
                i = !0, this.opened() ? this.close() : this.enabled && this.open(), w(e), i = !1
            })), r.bind("mousedown", this.bind(function () {
                this.search.focus()
            })), e.bind("focus", this.bind(function (e) {
                w(e)
            })), this.focusser.bind("focus", this.bind(function () {
                this.container.addClass("select2-container-active")
            })).bind("blur", this.bind(function () {
                this.opened() || this.container.removeClass("select2-container-active")
            })), this.search.bind("focus", this.bind(function () {
                this.container.addClass("select2-container-active")
            })), this.setPlaceholder()
        },
        clear: function () {
            var e = this.selection.data("select2-data");
            this.opts.element.val(""), this.selection.find("span").empty(), this.selection.removeData("select2-data"), this.setPlaceholder(), this.opts.element.trigger({
                type: "removed",
                val: this.id(e),
                choice: e
            }), this.triggerChange({
                removed: e
            })
        },
        initSelection: function () {
            var e;
            if (this.opts.element.val() === "" && this.opts.element.text() === "") this.close(), this.setPlaceholder();
            else {
                var n = this;
                this.opts.initSelection.call(null, this.opts.element, function (e) {
                    e !== t && e !== null && (n.updateSelection(e), n.close(), n.setPlaceholder())
                })
            }
        },
        prepareOpts: function () {
            var t = this.parent.prepareOpts.apply(this, arguments);
            return t.element.get(0).tagName.toLowerCase() === "select" ? t.initSelection = function (t, n) {
                var r = t.find(":selected");
                e.isFunction(n) && n({
                    id: r.attr("value"),
                    text: r.text(),
                    element: r
                })
            } : "data" in t && (t.initSelection = t.initSelection || function (n, r) {
                var i = n.val();
                t.query({
                    matcher: function (e, n, r) {
                        return c(i, t.id(r))
                    },
                    callback: e.isFunction(r) ? function (e) {
                        r(e.results.length ? e.results[0] : null)
                    } : e.noop
                })
            }), t
        },
        setPlaceholder: function () {
            var e = this.getPlaceholder();
            if (this.opts.element.val() === "" && e !== t) {
                if (this.select && this.select.find("option:first").text() !== "") return;
                this.selection.find("span").html(this.opts.escapeMarkup(e)), this.selection.addClass("select2-default"), this.selection.find("abbr").hide()
            }
        },
        postprocessResults: function (t, n) {
            var r = 0,
                i = this,
                s = !0;
            this.findHighlightableChoices().each2(function (e, t) {
                if (c(i.id(t.data("select2-data")), i.opts.element.val())) return r = e, !1
            }), this.highlight(r), n === !0 && (s = this.showSearchInput = O(t.results) >= this.opts.minimumResultsForSearch, this.dropdown.find(".select2-search")[s ? "removeClass" : "addClass"]("select2-search-hidden"), e(this.dropdown, this.container)[s ? "addClass" : "removeClass"]("select2-with-searchbox"))
        },
        onSelect: function (e, t) {
            var n = this.opts.element.val();
            this.opts.element.val(this.id(e)), this.updateSelection(e), this.opts.element.trigger({
                type: "selected",
                val: this.id(e),
                choice: e
            }), this.close(), (!t || !t.noFocus) && this.selection.focus(), c(n, this.id(e)) || this.triggerChange()
        },
        updateSelection: function (e) {
            var n = this.selection.find("span"),
                r;
            this.selection.data("select2-data", e), n.empty(), r = this.opts.formatSelection(e, n), r !== t && n.append(this.opts.escapeMarkup(r)), this.selection.removeClass("select2-default"), this.opts.allowClear && this.getPlaceholder() !== t && this.selection.find("abbr").show()
        },
        val: function () {
            var e, n = !1,
                r = null,
                i = this;
            if (arguments.length === 0) return this.opts.element.val();
            e = arguments[0], arguments.length > 1 && (n = arguments[1]);
            if (this.select) this.select.val(e).find(":selected").each2(function (e, t) {
                return r = {
                    id: t.attr("value"),
                    text: t.text()
                }, !1
            }), this.updateSelection(r), this.setPlaceholder(), n && this.triggerChange();
            else {
                if (this.opts.initSelection === t) throw new Error("cannot call val() if initSelection() is not defined");
                if (!e && e !== 0) {
                    this.clear(), n && this.triggerChange();
                    return
                }
                this.opts.element.val(e), this.opts.initSelection(this.opts.element, function (e) {
                    i.opts.element.val(e ? i.id(e) : ""), i.updateSelection(e), i.setPlaceholder(), n && i.triggerChange()
                })
            }
        },
        clearSearch: function () {
            this.search.val(""), this.focusser.val("")
        },
        data: function (e) {
            var n;
            if (arguments.length === 0) return n = this.selection.data("select2-data"), n == t && (n = null), n;
            !e || e === "" ? this.clear() : (this.opts.element.val(e ? this.id(e) : ""), this.updateSelection(e))
        }
    }), s = _(r, {
        createContainer: function () {
            var t = e(document.createElement("div")).attr({
                "class": "select2-container select2-container-multi"
            }).html(["    <ul class='select2-choices'>", "  <li class='select2-search-field'>", "    <input type='text' autocomplete='off' class='select2-input'>", "  </li>", "</ul>", "<div class='select2-drop select2-drop-multi' style='display:none;'>", "   <ul class='select2-results'>", "   </ul>", "</div>"].join(""));
            return t
        },
        prepareOpts: function () {
            var t = this.parent.prepareOpts.apply(this, arguments);
            return t.element.get(0).tagName.toLowerCase() === "select" ? t.initSelection = function (e, t) {
                var n = [];
                e.find(":selected").each2(function (e, t) {
                    n.push({
                        id: t.attr("value"),
                        text: t.text(),
                        element: t[0]
                    })
                }), t(n)
            } : "data" in t && (t.initSelection = t.initSelection || function (n, r) {
                var i = h(n.val(), t.separator);
                t.query({
                    matcher: function (n, r, s) {
                        return e.grep(i, function (e) {
                            return c(e, t.id(s))
                        }).length
                    },
                    callback: e.isFunction(r) ? function (e) {
                        r(e.results)
                    } : e.noop
                })
            }), t
        },
        initContainer: function () {
            var t = ".select2-choices",
                r;
            this.searchContainer = this.container.find(".select2-search-field"), this.selection = r = this.container.find(t), this.search.bind("input paste", this.bind(function () {
                if (!this.enabled) return;
                this.opened() || this.open()
            })), this.search.bind("keydown", this.bind(function (e) {
                if (!this.enabled) return;
                if (e.which === n.BACKSPACE && this.search.val() === "") {
                    this.close();
                    var t, i = r.find(".select2-search-choice-focus");
                    if (i.length > 0) {
                        this.unselect(i.first()), this.search.width(10), w(e);
                        return
                    }
                    t = r.find(".select2-search-choice:not(.select2-locked)"), t.length > 0 && t.last().addClass("select2-search-choice-focus")
                } else r.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus"); if (this.opened()) switch (e.which) {
                case n.UP:
                case n.DOWN:
                    this.moveHighlight(e.which === n.UP ? -1 : 1), w(e);
                    return;
                case n.ENTER:
                case n.TAB:
                    this.selectHighlighted(), w(e);
                    return;
                case n.ESC:
                    this.cancel(e), w(e);
                    return
                }
                if (e.which === n.TAB || n.isControl(e) || n.isFunctionKey(e) || e.which === n.BACKSPACE || e.which === n.ESC) return;
                if (e.which === n.ENTER) {
                    if (this.opts.openOnEnter === !1) return;
                    if (e.altKey || e.ctrlKey || e.shiftKey || e.metaKey) return
                }
                this.open(), (e.which === n.PAGE_UP || e.which === n.PAGE_DOWN) && w(e)
            })), this.search.bind("keyup", this.bind(this.resizeSearch)), this.search.bind("blur", this.bind(function (e) {
                this.container.removeClass("select2-container-active"), this.search.removeClass("select2-focused"), this.opened() || this.clearSearch(), e.stopImmediatePropagation()
            })), this.container.delegate(t, "mousedown", this.bind(function (t) {
                if (!this.enabled) return;
                if (e(t.target).closest(".select2-search-choice").length > 0) return;
                this.clearPlaceholder(), this.open(), this.focusSearch(), t.preventDefault()
            })), this.container.delegate(t, "focus", this.bind(function () {
                if (!this.enabled) return;
                this.container.addClass("select2-container-active"), this.dropdown.addClass("select2-drop-active"), this.clearPlaceholder()
            })), this.clearSearch()
        },
        enable: function () {
            if (this.enabled) return;
            this.parent.enable.apply(this, arguments), this.search.removeAttr("disabled")
        },
        disable: function () {
            if (!this.enabled) return;
            this.parent.disable.apply(this, arguments), this.search.attr("disabled", !0)
        },
        initSelection: function () {
            var e;
            this.opts.element.val() === "" && this.opts.element.text() === "" && (this.updateSelection([]), this.close(), this.clearSearch());
            if (this.select || this.opts.element.val() !== "") {
                var n = this;
                this.opts.initSelection.call(null, this.opts.element, function (e) {
                    e !== t && e !== null && (n.updateSelection(e), n.close(), n.clearSearch())
                })
            }
        },
        clearSearch: function () {
            var e = this.getPlaceholder();
            e !== t && this.getVal().length === 0 && this.search.hasClass("select2-focused") === !1 ? (this.search.val(e).addClass("select2-default"), this.resizeSearch()) : this.search.val("").width(10)
        },
        clearPlaceholder: function () {
            this.search.hasClass("select2-default") && this.search.val("").removeClass("select2-default")
        },
        opening: function () {
            this.parent.opening.apply(this, arguments), this.clearPlaceholder(), this.resizeSearch(), this.focusSearch(), this.opts.element.trigger(e.Event("open"))
        },
        close: function () {
            if (!this.opened()) return;
            this.parent.close.apply(this, arguments)
        },
        focus: function () {
            this.close(), this.search.focus(), this.opts.element.triggerHandler("focus")
        },
        isFocused: function () {
            return this.search.hasClass("select2-focused")
        },
        updateSelection: function (t) {
            var n = [],
                r = [],
                i = this;
            e(t).each(function () {
                l(i.id(this), n) < 0 && (n.push(i.id(this)), r.push(this))
            }), t = r, this.selection.find(".select2-search-choice").remove(), e(t).each(function () {
                i.addSelectedChoice(this)
            }), i.postprocessResults()
        },
        tokenize: function () {
            var e = this.search.val();
            e = this.opts.tokenizer(e, this.data(), this.bind(this.onSelect), this.opts), e != null && e != t && (this.search.val(e), e.length > 0 && this.open())
        },
        onSelect: function (e, t) {
            this.addSelectedChoice(e), this.opts.element.trigger({
                type: "selected",
                val: this.id(e),
                choice: e
            }), (this.select || !this.opts.closeOnSelect) && this.postprocessResults(), this.opts.closeOnSelect ? (this.close(), this.search.width(10)) : this.countSelectableResults() > 0 ? (this.search.width(10), this.resizeSearch(), this.val().length >= this.getMaximumSelectionSize() && this.updateResults(!0), this.positionDropdown()) : (this.close(), this.search.width(10)), this.triggerChange({
                added: e
            }), (!t || !t.noFocus) && this.focusSearch()
        },
        cancel: function () {
            this.close(), this.focusSearch()
        },
        addSelectedChoice: function (n) {
            var r = !n.locked,
                i = e("<li class='select2-search-choice'>    <div></div>    <a href='#' onclick='return false;' class='select2-search-choice-close' tabindex='-1'></a></li>"),
                s = e("<li class='select2-search-choice select2-locked'><div></div></li>"),
                o = r ? i : s,
                u = this.id(n),
                a = this.getVal(),
                f;
            f = this.opts.formatSelection(n, o.find("div")), f != t && o.find("div").replaceWith("<div>" + this.opts.escapeMarkup(f) + "</div>"), r && o.find(".select2-search-choice-close").bind("mousedown", w).bind("click dblclick", this.bind(function (t) {
                if (!this.enabled) return;
                e(t.target).closest(".select2-search-choice").fadeOut("fast", this.bind(function () {
                    this.unselect(e(t.target)), this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus"), this.close(), this.focusSearch()
                })).dequeue(), w(t)
            })).bind("focus", this.bind(function () {
                if (!this.enabled) return;
                this.container.addClass("select2-container-active"), this.dropdown.addClass("select2-drop-active")
            })), o.data("select2-data", n), o.insertBefore(this.searchContainer), a.push(u), this.setVal(a)
        },
        unselect: function (e) {
            var t = this.getVal(),
                n, r;
            e = e.closest(".select2-search-choice");
            if (e.length === 0) throw "Invalid argument: " + e + ". Must be .select2-search-choice";
            n = e.data("select2-data");
            if (!n) return;
            r = l(this.id(n), t), r >= 0 && (t.splice(r, 1), this.setVal(t), this.select && this.postprocessResults()), e.remove(), this.opts.element.trigger({
                type: "removed",
                val: this.id(n),
                choice: n
            }), this.triggerChange({
                removed: n
            })
        },
        postprocessResults: function () {
            var e = this.getVal(),
                t = this.results.find(".select2-result"),
                n = this.results.find(".select2-result-with-children"),
                r = this;
            t.each2(function (t, n) {
                var i = r.id(n.data("select2-data"));
                l(i, e) >= 0 && (n.addClass("select2-selected"), n.find(".select2-result-selectable").addClass("select2-selected"))
            }), n.each2(function (e, t) {
                !t.is(".select2-result-selectable") && t.find(".select2-result-selectable:not(.select2-selected)").length === 0 && t.addClass("select2-selected")
            }), this.highlight() == -1 && r.highlight(0)
        },
        resizeSearch: function () {
            var e, t, n, r, i, s = p(this.search);
            e = S(this.search) + 10, t = this.search.offset().left, n = this.selection.width(), r = this.selection.offset().left, i = n - (t - r) - s, i < e && (i = n - s), i < 40 && (i = n - s), i <= 0 && (i = e), this.search.width(i)
        },
        getVal: function () {
            var e;
            return this.select ? (e = this.select.val(), e === null ? [] : e) : (e = this.opts.element.val(), h(e, this.opts.separator))
        },
        setVal: function (t) {
            var n;
            this.select ? this.select.val(t) : (n = [], e(t).each(function () {
                l(this, n) < 0 && n.push(this)
            }), this.opts.element.val(n.length === 0 ? "" : n.join(this.opts.separator)))
        },
        val: function () {
            var n, r = !1,
                i = [],
                s = this;
            if (arguments.length === 0) return this.getVal();
            n = arguments[0], arguments.length > 1 && (r = arguments[1]);
            if (!n && n !== 0) {
                this.opts.element.val(""), this.updateSelection([]), this.clearSearch(), r && this.triggerChange();
                return
            }
            this.setVal(n);
            if (this.select) this.opts.initSelection(this.select, this.bind(this.updateSelection)), r && this.triggerChange();
            else {
                if (this.opts.initSelection === t) throw new Error("val() cannot be called if initSelection() is not defined");
                this.opts.initSelection(this.opts.element, function (t) {
                    var n = e(t).map(s.id);
                    s.setVal(n), s.updateSelection(t), s.clearSearch(), r && s.triggerChange()
                })
            }
            this.clearSearch()
        },
        onSortStart: function () {
            if (this.select) throw new Error("Sorting of elements is not supported when attached to <select>. Attach to <input type='hidden'/> instead.");
            this.search.width(0), this.searchContainer.hide()
        },
        onSortEnd: function () {
            var t = [],
                n = this;
            this.searchContainer.show(), this.searchContainer.appendTo(this.searchContainer.parent()), this.resizeSearch(), this.selection.find(".select2-search-choice").each(function () {
                t.push(n.opts.id(e(this).data("select2-data")))
            }), this.setVal(t), this.triggerChange()
        },
        data: function (t) {
            var n = this,
                r;
            if (arguments.length === 0) return this.selection.find(".select2-search-choice").map(function () {
                return e(this).data("select2-data")
            }).get();
            t || (t = []), r = e.map(t, function (e) {
                return n.opts.id(e)
            }), this.setVal(r), this.updateSelection(t), this.clearSearch()
        }
    }), e.fn.select2 = function () {
        var n = Array.prototype.slice.call(arguments, 0),
            r, o, u, a, f = ["val", "destroy", "opened", "open", "close", "focus", "isFocused", "container", "onSortStart", "onSortEnd", "enable", "disable", "positionDropdown", "data"];
        return this.each(function () {
            if (n.length === 0 || typeof n[0] == "object") r = n.length === 0 ? {} : e.extend({}, n[0]), r.element = e(this), r.element.get(0).tagName.toLowerCase() === "select" ? a = r.element.attr("multiple") : (a = r.multiple || !1, "tags" in r && (r.multiple = a = !0)), o = a ? new s : new i, o.init(r);
            else {
                if (typeof n[0] != "string") throw "Invalid arguments to select2 plugin: " + n;
                if (l(n[0], f) < 0) throw "Unknown method: " + n[0];
                u = t, o = e(this).data("select2");
                if (o === t) return;
                n[0] === "container" ? u = o.container : u = o[n[0]].apply(o, n.slice(1));
                if (u !== t) return !1
            }
        }), u === t ? this : u
    }, e.fn.select2.defaults = {
        width: "copy",
        loadMorePadding: 0,
        closeOnSelect: !0,
        openOnEnter: !0,
        containerCss: {},
        dropdownCss: {},
        containerCssClass: "",
        dropdownCssClass: "",
        formatResult: function (e, t, n, r) {
            var i = [];
            return T(e.text, n.term, i, r), i.join("")
        },
        formatSelection: function (e, n) {
            return e ? e.text : t
        },
        sortResults: function (e, t, n) {
            return e
        },
        formatResultCssClass: function (e) {
            return t
        },
        formatNoMatches: function () {
            return "No matches found"
        },
        formatInputTooShort: function (e, t) {
            var n = t - e.length;
            return "Please enter " + n + " more character" + (n == 1 ? "" : "s")
        },
        formatInputTooLong: function (e, t) {
            var n = e.length - t;
            return "Please enter " + n + " less character" + (n == 1 ? "" : "s")
        },
        formatSelectionTooBig: function (e) {
            return "You can only select " + e + " item" + (e == 1 ? "" : "s")
        },
        formatLoadMore: function (e) {
            return "Loading more results..."
        },
        formatSearching: function () {
            return "Searching..."
        },
        minimumResultsForSearch: 0,
        minimumInputLength: 0,
        maximumInputLength: null,
        maximumSelectionSize: 0,
        id: function (e) {
            return e.id
        },
        matcher: function (e, t) {
            return t.toUpperCase().indexOf(e.toUpperCase()) >= 0
        },
        separator: ",",
        tokenSeparators: [],
        tokenizer: M,
        escapeMarkup: function (e) {
            var t = {
                "\\": "&#92;",
                "&": "&amp;",
                "<": "&lt;",
                ">": "&gt;",
                '"': "&quot;",
                "'": "&apos;",
                "/": "&#47;"
            };
            return String(e).replace(/[&<>"'/\\]/g, function (e) {
                return t[e[0]]
            })
        },
        blurOnChange: !1,
        selectOnBlur: !1,
        adaptContainerCssClass: function (e) {
            return e
        },
        adaptDropdownCssClass: function (e) {
            return null
        }
    }, window.Select2 = {
        query: {
            ajax: N,
            local: C,
            tags: k
        },
        util: {
            debounce: m,
            markMatch: T
        },
        "class": {
            "abstract": r,
            single: i,
            multi: s
        }
    }
}(jQuery),
function () {
    function e(e, t) {
        try {
            for (var n in t) Object.defineProperty(e.prototype, n, {
                value: t[n],
                enumerable: !1
            })
        } catch (r) {
            e.prototype = t
        }
    }

    function t(e) {
        var t = -1,
            n = e.length,
            r = [];
        while (++t < n) r.push(e[t]);
        return r
    }

    function n(e) {
        return Array.prototype.slice.call(e)
    }

    function r() {}

    function i(e) {
        return e
    }

    function s() {
        return this
    }

    function o() {
        return !0
    }

    function u(e) {
        return typeof e == "function" ? e : function () {
            return e
        }
    }

    function a(e, t, n) {
        return function () {
            var r = n.apply(t, arguments);
            return arguments.length ? e : r
        }
    }

    function f(e) {
        return e != null && !isNaN(e)
    }

    function l(e) {
        return e.length
    }

    function c(e) {
        return e == null
    }

    function h(e) {
        return e.trim().replace(/\s+/g, " ")
    }

    function p(e) {
        var t = 1;
        while (e * t % 1) t *= 10;
        return t
    }

    function d() {}

    function v(e) {
        function t() {
            var t = n,
                r = -1,
                i = t.length,
                s;
            while (++r < i)(s = t[r].on) && s.apply(this, arguments);
            return e
        }
        var n = [],
            i = new r;
        return t.on = function (t, r) {
            var s = i.get(t),
                o;
            return arguments.length < 2 ? s && s.on : (s && (s.on = null, n = n.slice(0, o = n.indexOf(s)).concat(n.slice(o + 1)), i.remove(t)), r && n.push(i.set(t, {
                on: r
            })), e)
        }, t
    }

    function m(e, t) {
        return t - (e ? 1 + Math.floor(Math.log(e + Math.pow(10, 1 + Math.floor(Math.log(e) / Math.LN10) - t)) / Math.LN10) : 1)
    }

    function g(e) {
        return e + ""
    }

    function y(e) {
        var t = e.lastIndexOf("."),
            n = t >= 0 ? e.substring(t) : (t = e.length, ""),
            r = [];
        while (t > 0) r.push(e.substring(t -= 3, t + 3));
        return r.reverse().join(",") + n
    }

    function b(e, t) {
        var n = Math.pow(10, Math.abs(8 - t) * 3);
        return {
            scale: t > 8 ? function (e) {
                return e / n
            } : function (e) {
                return e * n
            },
            symbol: e
        }
    }

    function w(e) {
        return function (t) {
            return t <= 0 ? 0 : t >= 1 ? 1 : e(t)
        }
    }

    function E(e) {
        return function (t) {
            return 1 - e(1 - t)
        }
    }

    function S(e) {
        return function (t) {
            return .5 * (t < .5 ? e(2 * t) : 2 - e(2 - 2 * t))
        }
    }

    function x(e) {
        return e
    }

    function T(e) {
        return function (t) {
            return Math.pow(t, e)
        }
    }

    function N(e) {
        return 1 - Math.cos(e * Math.PI / 2)
    }

    function C(e) {
        return Math.pow(2, 10 * (e - 1))
    }

    function k(e) {
        return 1 - Math.sqrt(1 - e * e)
    }

    function L(e, t) {
        var n;
        return arguments.length < 2 && (t = .45), arguments.length < 1 ? (e = 1, n = t / 4) : n = t / (2 * Math.PI) * Math.asin(1 / e),
        function (r) {
            return 1 + e * Math.pow(2, 10 * -r) * Math.sin((r - n) * 2 * Math.PI / t)
        }
    }

    function A(e) {
        return e || (e = 1.70158),
        function (t) {
            return t * t * ((e + 1) * t - e)
        }
    }

    function O(e) {
        return e < 1 / 2.75 ? 7.5625 * e * e : e < 2 / 2.75 ? 7.5625 * (e -= 1.5 / 2.75) * e + .75 : e < 2.5 / 2.75 ? 7.5625 * (e -= 2.25 / 2.75) * e + .9375 : 7.5625 * (e -= 2.625 / 2.75) * e + .984375
    }

    function M() {
        d3.event.stopPropagation(), d3.event.preventDefault()
    }

    function _() {
        var e = d3.event,
            t;
        while (t = e.sourceEvent) e = t;
        return e
    }

    function D(e) {
        var t = new d,
            n = 0,
            r = arguments.length;
        while (++n < r) t[arguments[n]] = v(t);
        return t.of = function (n, r) {
            return function (i) {
                try {
                    var s = i.sourceEvent = d3.event;
                    i.target = e, d3.event = i, t[i.type].apply(n, r)
                } finally {
                    d3.event = s
                }
            }
        }, t
    }

    function P(e) {
        var t = [e.a, e.b],
            n = [e.c, e.d],
            r = B(t),
            i = H(t, n),
            s = B(j(n, t, -i)) || 0;
        t[0] * n[1] < n[0] * t[1] && (t[0] *= -1, t[1] *= -1, r *= -1, i *= -1), this.rotate = (r ? Math.atan2(t[1], t[0]) : Math.atan2(-n[0], n[1])) * ls, this.translate = [e.e, e.f], this.scale = [r, s], this.skew = s ? Math.atan2(i, s) * ls : 0
    }

    function H(e, t) {
        return e[0] * t[0] + e[1] * t[1]
    }

    function B(e) {
        var t = Math.sqrt(H(e, e));
        return t && (e[0] /= t, e[1] /= t), t
    }

    function j(e, t, n) {
        return e[0] += n * t[0], e[1] += n * t[1], e
    }

    function F(e) {
        return e == "transform" ? d3.interpolateTransform : d3.interpolate
    }

    function I(e, t) {
        return t = t - (e = +e) ? 1 / (t - e) : 0,
        function (n) {
            return (n - e) * t
        }
    }

    function q(e, t) {
        return t = t - (e = +e) ? 1 / (t - e) : 0,
        function (n) {
            return Math.max(0, Math.min(1, (n - e) * t))
        }
    }

    function R() {}

    function U(e, t, n) {
        return new z(e, t, n)
    }

    function z(e, t, n) {
        this.r = e, this.g = t, this.b = n
    }

    function W(e) {
        return e < 16 ? "0" + Math.max(0, e).toString(16) : Math.min(255, e).toString(16)
    }

    function X(e, t, n) {
        var r = 0,
            i = 0,
            s = 0,
            o, u, a;
        o = /([a-z]+)\((.*)\)/i.exec(e);
        if (o) {
            u = o[2].split(",");
            switch (o[1]) {
            case "hsl":
                return n(parseFloat(u[0]), parseFloat(u[1]) / 100, parseFloat(u[2]) / 100);
            case "rgb":
                return t(K(u[0]), K(u[1]), K(u[2]))
            }
        }
        return (a = ds.get(e)) ? t(a.r, a.g, a.b) : (e != null && e.charAt(0) === "#" && (e.length === 4 ? (r = e.charAt(1), r += r, i = e.charAt(2), i += i, s = e.charAt(3), s += s) : e.length === 7 && (r = e.substring(1, 3), i = e.substring(3, 5), s = e.substring(5, 7)), r = parseInt(r, 16), i = parseInt(i, 16), s = parseInt(s, 16)), t(r, i, s))
    }

    function V(e, t, n) {
        var r = Math.min(e /= 255, t /= 255, n /= 255),
            i = Math.max(e, t, n),
            s = i - r,
            o, u, a = (i + r) / 2;
        return s ? (u = a < .5 ? s / (i + r) : s / (2 - i - r), e == i ? o = (t - n) / s + (t < n ? 6 : 0) : t == i ? o = (n - e) / s + 2 : o = (e - t) / s + 4, o *= 60) : u = o = 0, Q(o, u, a)
    }

    function $(e, t, n) {
        e = J(e), t = J(t), n = J(n);
        var r = ut((.4124564 * e + .3575761 * t + .1804375 * n) / ys),
            i = ut((.2126729 * e + .7151522 * t + .072175 * n) / bs),
            s = ut((.0193339 * e + .119192 * t + .9503041 * n) / ws);
        return nt(116 * i - 16, 500 * (r - i), 200 * (i - s))
    }

    function J(e) {
        return (e /= 255) <= .04045 ? e / 12.92 : Math.pow((e + .055) / 1.055, 2.4)
    }

    function K(e) {
        var t = parseFloat(e);
        return e.charAt(e.length - 1) === "%" ? Math.round(t * 2.55) : t
    }

    function Q(e, t, n) {
        return new G(e, t, n)
    }

    function G(e, t, n) {
        this.h = e, this.s = t, this.l = n
    }

    function Y(e, t, n) {
        function r(e) {
            return e > 360 ? e -= 360 : e < 0 && (e += 360), e < 60 ? s + (o - s) * e / 60 : e < 180 ? o : e < 240 ? s + (o - s) * (240 - e) / 60 : s
        }

        function i(e) {
            return Math.round(r(e) * 255)
        }
        var s, o;
        return e %= 360, e < 0 && (e += 360), t = t < 0 ? 0 : t > 1 ? 1 : t, n = n < 0 ? 0 : n > 1 ? 1 : n, o = n <= .5 ? n * (1 + t) : n + t - n * t, s = 2 * n - o, U(i(e + 120), i(e), i(e - 120))
    }

    function Z(e, t, n) {
        return new et(e, t, n)
    }

    function et(e, t, n) {
        this.h = e, this.c = t, this.l = n
    }

    function tt(e, t, n) {
        return nt(n, Math.cos(e *= Math.PI / 180) * t, Math.sin(e) * t)
    }

    function nt(e, t, n) {
        return new rt(e, t, n)
    }

    function rt(e, t, n) {
        this.l = e, this.a = t, this.b = n
    }

    function it(e, t, n) {
        var r = (e + 16) / 116,
            i = r + t / 500,
            s = r - n / 200;
        return i = ot(i) * ys, r = ot(r) * bs, s = ot(s) * ws, U(at(3.2404542 * i - 1.5371385 * r - .4985314 * s), at(-0.969266 * i + 1.8760108 * r + .041556 * s), at(.0556434 * i - .2040259 * r + 1.0572252 * s))
    }

    function st(e, t, n) {
        return Z(Math.atan2(n, t) / Math.PI * 180, Math.sqrt(t * t + n * n), e)
    }

    function ot(e) {
        return e > .206893034 ? e * e * e : (e - 4 / 29) / 7.787037
    }

    function ut(e) {
        return e > .008856 ? Math.pow(e, 1 / 3) : 7.787037 * e + 4 / 29
    }

    function at(e) {
        return Math.round(255 * (e <= .00304 ? 12.92 * e : 1.055 * Math.pow(e, 1 / 2.4) - .055))
    }

    function ft(e) {
        return Qi(e, ks), e
    }

    function lt(e) {
        return function () {
            return Ss(e, this)
        }
    }

    function ct(e) {
        return function () {
            return xs(e, this)
        }
    }

    function ht(e, t) {
        function n() {
            this.removeAttribute(e)
        }

        function r() {
            this.removeAttributeNS(e.space, e.local)
        }

        function i() {
            this.setAttribute(e, t)
        }

        function s() {
            this.setAttributeNS(e.space, e.local, t)
        }

        function o() {
            var n = t.apply(this, arguments);
            n == null ? this.removeAttribute(e) : this.setAttribute(e, n)
        }

        function u() {
            var n = t.apply(this, arguments);
            n == null ? this.removeAttributeNS(e.space, e.local) : this.setAttributeNS(e.space, e.local, n)
        }
        return e = d3.ns.qualify(e), t == null ? e.local ? r : n : typeof t == "function" ? e.local ? u : o : e.local ? s : i
    }

    function pt(e) {
        return new RegExp("(?:^|\\s+)" + d3.requote(e) + "(?:\\s+|$)", "g")
    }

    function dt(e, t) {
        function n() {
            var n = -1;
            while (++n < i) e[n](this, t)
        }

        function r() {
            var n = -1,
                r = t.apply(this, arguments);
            while (++n < i) e[n](this, r)
        }
        e = e.trim().split(/\s+/).map(vt);
        var i = e.length;
        return typeof t == "function" ? r : n
    }

    function vt(e) {
        var t = pt(e);
        return function (n, r) {
            if (i = n.classList) return r ? i.add(e) : i.remove(e);
            var i = n.className,
                s = i.baseVal != null,
                o = s ? i.baseVal : i;
            r ? (t.lastIndex = 0, t.test(o) || (o = h(o + " " + e), s ? i.baseVal = o : n.className = o)) : o && (o = h(o.replace(t, " ")), s ? i.baseVal = o : n.className = o)
        }
    }

    function mt(e, t, n) {
        function r() {
            this.style.removeProperty(e)
        }

        function i() {
            this.style.setProperty(e, t, n)
        }

        function s() {
            var r = t.apply(this, arguments);
            r == null ? this.style.removeProperty(e) : this.style.setProperty(e, r, n)
        }
        return t == null ? r : typeof t == "function" ? s : i
    }

    function gt(e, t) {
        function n() {
            delete this[e]
        }

        function r() {
            this[e] = t
        }

        function i() {
            var n = t.apply(this, arguments);
            n == null ? delete this[e] : this[e] = n
        }
        return t == null ? n : typeof t == "function" ? i : r
    }

    function yt(e) {
        return {
            __data__: e
        }
    }

    function bt(e) {
        return function () {
            return Cs(this, e)
        }
    }

    function wt(e) {
        return arguments.length || (e = d3.ascending),
        function (t, n) {
            return e(t && t.__data__, n && n.__data__)
        }
    }

    function Et(e, t, n) {
        function r() {
            var t = this[s];
            t && (this.removeEventListener(e, t, t.$), delete this[s])
        }

        function i() {
            function i(e) {
                var n = d3.event;
                d3.event = e, u[0] = o.__data__;
                try {
                    t.apply(o, u)
                } finally {
                    d3.event = n
                }
            }
            var o = this,
                u = arguments;
            r.call(this), this.addEventListener(e, this[s] = i, i.$ = n), i._ = t
        }
        var s = "__on" + e,
            o = e.indexOf(".");
        return o > 0 && (e = e.substring(0, o)), t ? i : r
    }

    function St(e, t) {
        for (var n = 0, r = e.length; n < r; n++)
            for (var i = e[n], s = 0, o = i.length, u; s < o; s++)(u = i[s]) && t(u, s, n);
        return e
    }

    function xt(e) {
        return Qi(e, As), e
    }

    function Tt(e, t, n) {
        Qi(e, Os);
        var i = new r,
            s = d3.dispatch("start", "end"),
            o = Fs;
        return e.id = t, e.time = n, e.tween = function (t, n) {
            return arguments.length < 2 ? i.get(t) : (n == null ? i.remove(t) : i.set(t, n), e)
        }, e.ease = function (t) {
            return arguments.length ? (o = typeof t == "function" ? t : d3.ease.apply(d3, arguments), e) : o
        }, e.each = function (t, n) {
            return arguments.length < 2 ? Nt.call(e, t) : (s.on(t, n), e)
        }, d3.timer(function (r) {
            return St(e, function (e, u, a) {
                function f(r) {
                    return v.active > t ? c() : (v.active = t, i.forEach(function (t, n) {
                        (n = n.call(e, m, u)) && h.push(n)
                    }), s.start.call(e, m, u), l(r) || d3.timer(l, 0, n), 1)
                }

                function l(n) {
                    if (v.active !== t) return c();
                    var r = (n - p) / d,
                        i = o(r),
                        a = h.length;
                    while (a > 0) h[--a].call(e, i);
                    if (r >= 1) return c(), _s = t, s.end.call(e, m, u), _s = 0, 1
                }

                function c() {
                    return --v.count || delete e.__transition__, 1
                }
                var h = [],
                    p = e.delay,
                    d = e.duration,
                    v = (e = e.node).__transition__ || (e.__transition__ = {
                        active: 0,
                        count: 0
                    }),
                    m = e.__data__;
                ++v.count, p <= r ? f(r) : d3.timer(f, p, n)
            })
        }, 0, n), e
    }

    function Nt(e) {
        var t = _s,
            n = Fs,
            r = Bs,
            i = js;
        return _s = this.id, Fs = this.ease(), St(this, function (t, n, r) {
            Bs = t.delay, js = t.duration, e.call(t = t.node, t.__data__, n, r)
        }), _s = t, Fs = n, Bs = r, js = i, this
    }

    function Ct(e, t, n) {
        return n != "" && Is
    }

    function kt(e, t) {
        return d3.tween(e, F(t))
    }

    function Lt() {
        var e, t = Date.now(),
            n = Us;
        while (n) e = t - n.then, e >= n.delay && (n.flush = n.callback(e)), n = n.next;
        var r = At() - t;
        r > 24 ? (isFinite(r) && (clearTimeout(Ws), Ws = setTimeout(Lt, r)), zs = 0) : (zs = 1, Xs(Lt))
    }

    function At() {
        var e = null,
            t = Us,
            n = Infinity;
        while (t) t.flush ? (delete Rs[t.callback.id], t = e ? e.next = t.next : Us = t.next) : (n = Math.min(n, t.then + t.delay), t = (e = t).next);
        return n
    }

    function Ot(e, t) {
        var n = e.ownerSVGElement || e;
        if (n.createSVGPoint) {
            var r = n.createSVGPoint();
            if (Vs < 0 && (window.scrollX || window.scrollY)) {
                n = d3.select(document.body).append("svg").style("position", "absolute").style("top", 0).style("left", 0);
                var i = n[0][0].getScreenCTM();
                Vs = !i.f && !i.e, n.remove()
            }
            return Vs ? (r.x = t.pageX, r.y = t.pageY) : (r.x = t.clientX, r.y = t.clientY), r = r.matrixTransform(e.getScreenCTM().inverse()), [r.x, r.y]
        }
        var s = e.getBoundingClientRect();
        return [t.clientX - s.left - e.clientLeft, t.clientY - s.top - e.clientTop]
    }

    function Mt() {}

    function _t(e) {
        var t = e[0],
            n = e[e.length - 1];
        return t < n ? [t, n] : [n, t]
    }

    function Dt(e) {
        return e.rangeExtent ? e.rangeExtent() : _t(e.range())
    }

    function Pt(e, t) {
        var n = 0,
            r = e.length - 1,
            i = e[n],
            s = e[r],
            o;
        s < i && (o = n, n = r, r = o, o = i, i = s, s = o);
        if (t = t(s - i)) e[n] = t.floor(i), e[r] = t.ceil(s);
        return e
    }

    function Ht() {
        return Math
    }

    function Bt(e, t, n, r) {
        function i() {
            var i = Math.min(e.length, t.length) > 2 ? zt : Ut,
                a = r ? q : I;
            return o = i(e, t, a, n), u = i(t, e, a, d3.interpolate), s
        }

        function s(e) {
            return o(e)
        }
        var o, u;
        return s.invert = function (e) {
            return u(e)
        }, s.domain = function (t) {
            return arguments.length ? (e = t.map(Number), i()) : e
        }, s.range = function (e) {
            return arguments.length ? (t = e, i()) : t
        }, s.rangeRound = function (e) {
            return s.range(e).interpolate(d3.interpolateRound)
        }, s.clamp = function (e) {
            return arguments.length ? (r = e, i()) : r
        }, s.interpolate = function (e) {
            return arguments.length ? (n = e, i()) : n
        }, s.ticks = function (t) {
            return qt(e, t)
        }, s.tickFormat = function (t) {
            return Rt(e, t)
        }, s.nice = function () {
            return Pt(e, Ft), i()
        }, s.copy = function () {
            return Bt(e, t, n, r)
        }, i()
    }

    function jt(e, t) {
        return d3.rebind(e, t, "range", "rangeRound", "interpolate", "clamp")
    }

    function Ft(e) {
        return e = Math.pow(10, Math.round(Math.log(e) / Math.LN10) - 1), e && {
            floor: function (t) {
                return Math.floor(t / e) * e
            },
            ceil: function (t) {
                return Math.ceil(t / e) * e
            }
        }
    }

    function It(e, t) {
        var n = _t(e),
            r = n[1] - n[0],
            i = Math.pow(10, Math.floor(Math.log(r / t) / Math.LN10)),
            s = t / r * i;
        return s <= .15 ? i *= 10 : s <= .35 ? i *= 5 : s <= .75 && (i *= 2), n[0] = Math.ceil(n[0] / i) * i, n[1] = Math.floor(n[1] / i) * i + i * .5, n[2] = i, n
    }

    function qt(e, t) {
        return d3.range.apply(d3, It(e, t))
    }

    function Rt(e, t) {
        return d3.format(",." + Math.max(0, -Math.floor(Math.log(It(e, t)[2]) / Math.LN10 + .01)) + "f")
    }

    function Ut(e, t, n, r) {
        var i = n(e[0], e[1]),
            s = r(t[0], t[1]);
        return function (e) {
            return s(i(e))
        }
    }

    function zt(e, t, n, r) {
        var i = [],
            s = [],
            o = 0,
            u = Math.min(e.length, t.length) - 1;
        e[u] < e[0] && (e = e.slice().reverse(), t = t.slice().reverse());
        while (++o <= u) i.push(n(e[o - 1], e[o])), s.push(r(t[o - 1], t[o]));
        return function (t) {
            var n = d3.bisect(e, t, 1, u) - 1;
            return s[n](i[n](t))
        }
    }

    function Wt(e, t) {
        function n(n) {
            return e(t(n))
        }
        var r = t.pow;
        return n.invert = function (t) {
            return r(e.invert(t))
        }, n.domain = function (i) {
            return arguments.length ? (t = i[0] < 0 ? Vt : Xt, r = t.pow, e.domain(i.map(t)), n) : e.domain().map(r)
        }, n.nice = function () {
            return e.domain(Pt(e.domain(), Ht)), n
        }, n.ticks = function () {
            var n = _t(e.domain()),
                i = [];
            if (n.every(isFinite)) {
                var s = Math.floor(n[0]),
                    o = Math.ceil(n[1]),
                    u = r(n[0]),
                    a = r(n[1]);
                if (t === Vt) {
                    i.push(r(s));
                    for (; s++ < o;)
                        for (var f = 9; f > 0; f--) i.push(r(s) * f)
                } else {
                    for (; s < o; s++)
                        for (var f = 1; f < 10; f++) i.push(r(s) * f);
                    i.push(r(s))
                }
                for (s = 0; i[s] < u; s++);
                for (o = i.length; i[o - 1] > a; o--);
                i = i.slice(s, o)
            }
            return i
        }, n.tickFormat = function (e, i) {
            arguments.length < 2 && (i = $s);
            if (arguments.length < 1) return i;
            var s = Math.max(.1, e / n.ticks().length),
                o = t === Vt ? (u = -1e-12, Math.floor) : (u = 1e-12, Math.ceil),
                u;
            return function (e) {
                return e / r(o(t(e) + u)) <= s ? i(e) : ""
            }
        }, n.copy = function () {
            return Wt(e.copy(), t)
        }, jt(n, e)
    }

    function Xt(e) {
        return Math.log(e < 0 ? 0 : e) / Math.LN10
    }

    function Vt(e) {
        return -Math.log(e > 0 ? 0 : -e) / Math.LN10
    }

    function $t(e, t) {
        function n(t) {
            return e(r(t))
        }
        var r = Jt(t),
            i = Jt(1 / t);
        return n.invert = function (t) {
            return i(e.invert(t))
        }, n.domain = function (t) {
            return arguments.length ? (e.domain(t.map(r)), n) : e.domain().map(i)
        }, n.ticks = function (e) {
            return qt(n.domain(), e)
        }, n.tickFormat = function (e) {
            return Rt(n.domain(), e)
        }, n.nice = function () {
            return n.domain(Pt(n.domain(), Ft))
        }, n.exponent = function (e) {
            if (!arguments.length) return t;
            var s = n.domain();
            return r = Jt(t = e), i = Jt(1 / t), n.domain(s)
        }, n.copy = function () {
            return $t(e.copy(), t)
        }, jt(n, e)
    }

    function Jt(e) {
        return function (t) {
            return t < 0 ? -Math.pow(-t, e) : Math.pow(t, e)
        }
    }

    function Kt(e, t) {
        function n(t) {
            return o[((s.get(t) || s.set(t, e.push(t))) - 1) % o.length]
        }

        function i(t, n) {
            return d3.range(e.length).map(function (e) {
                return t + n * e
            })
        }
        var s, o, u;
        return n.domain = function (i) {
            if (!arguments.length) return e;
            e = [], s = new r;
            var o = -1,
                u = i.length,
                a;
            while (++o < u) s.has(a = i[o]) || s.set(a, e.push(a));
            return n[t.t].apply(n, t.a)
        }, n.range = function (e) {
            return arguments.length ? (o = e, u = 0, t = {
                t: "range",
                a: arguments
            }, n) : o
        }, n.rangePoints = function (r, s) {
            arguments.length < 2 && (s = 0);
            var a = r[0],
                f = r[1],
                l = (f - a) / (Math.max(1, e.length - 1) + s);
            return o = i(e.length < 2 ? (a + f) / 2 : a + l * s / 2, l), u = 0, t = {
                t: "rangePoints",
                a: arguments
            }, n
        }, n.rangeBands = function (r, s, a) {
            arguments.length < 2 && (s = 0), arguments.length < 3 && (a = s);
            var f = r[1] < r[0],
                l = r[f - 0],
                c = r[1 - f],
                h = (c - l) / (e.length - s + 2 * a);
            return o = i(l + h * a, h), f && o.reverse(), u = h * (1 - s), t = {
                t: "rangeBands",
                a: arguments
            }, n
        }, n.rangeRoundBands = function (r, s, a) {
            arguments.length < 2 && (s = 0), arguments.length < 3 && (a = s);
            var f = r[1] < r[0],
                l = r[f - 0],
                c = r[1 - f],
                h = Math.floor((c - l) / (e.length - s + 2 * a)),
                p = c - l - (e.length - s) * h;
            return o = i(l + Math.round(p / 2), h), f && o.reverse(), u = Math.round(h * (1 - s)), t = {
                t: "rangeRoundBands",
                a: arguments
            }, n
        }, n.rangeBand = function () {
            return u
        }, n.rangeExtent = function () {
            return _t(t.a[0])
        }, n.copy = function () {
            return Kt(e, t)
        }, n.domain(e)
    }

    function Qt(e, t) {
        function n() {
            var n = 0,
                s = e.length,
                o = t.length;
            i = [];
            while (++n < o) i[n - 1] = d3.quantile(e, n / o);
            return r
        }

        function r(e) {
            return isNaN(e = +e) ? NaN : t[d3.bisect(i, e)]
        }
        var i;
        return r.domain = function (t) {
            return arguments.length ? (e = t.filter(function (e) {
                return !isNaN(e)
            }).sort(d3.ascending), n()) : e
        }, r.range = function (e) {
            return arguments.length ? (t = e, n()) : t
        }, r.quantiles = function () {
            return i
        }, r.copy = function () {
            return Qt(e, t)
        }, n()
    }

    function Gt(e, t, n) {
        function r(t) {
            return n[Math.max(0, Math.min(o, Math.floor(s * (t - e))))]
        }

        function i() {
            return s = n.length / (t - e), o = n.length - 1, r
        }
        var s, o;
        return r.domain = function (n) {
            return arguments.length ? (e = +n[0], t = +n[n.length - 1], i()) : [e, t]
        }, r.range = function (e) {
            return arguments.length ? (n = e, i()) : n
        }, r.copy = function () {
            return Gt(e, t, n)
        }, i()
    }

    function Yt(e, t) {
        function n(n) {
            return t[d3.bisect(e, n)]
        }
        return n.domain = function (t) {
            return arguments.length ? (e = t, n) : e
        }, n.range = function (e) {
            return arguments.length ? (t = e, n) : t
        }, n.copy = function () {
            return Yt(e, t)
        }, n
    }

    function Zt(e) {
        function t(e) {
            return +e
        }
        return t.invert = t, t.domain = t.range = function (n) {
            return arguments.length ? (e = n.map(t), t) : e
        }, t.ticks = function (t) {
            return qt(e, t)
        }, t.tickFormat = function (t) {
            return Rt(e, t)
        }, t.copy = function () {
            return Zt(e)
        }, t
    }

    function en(e) {
        return e.innerRadius
    }

    function tn(e) {
        return e.outerRadius
    }

    function nn(e) {
        return e.startAngle
    }

    function rn(e) {
        return e.endAngle
    }

    function sn(e) {
        function t(t) {
            function o() {
                a.push("M", s(e(l), f))
            }
            var a = [],
                l = [],
                c = -1,
                h = t.length,
                p, d = u(n),
                v = u(r);
            while (++c < h) i.call(this, p = t[c], c) ? l.push([+d.call(this, p, c), +v.call(this, p, c)]) : l.length && (o(), l = []);
            return l.length && o(), a.length ? a.join("") : null
        }
        var n = on,
            r = un,
            i = o,
            s = an,
            a = s.key,
            f = .7;
        return t.x = function (e) {
            return arguments.length ? (n = e, t) : n
        }, t.y = function (e) {
            return arguments.length ? (r = e, t) : r
        }, t.defined = function (e) {
            return arguments.length ? (i = e, t) : i
        }, t.interpolate = function (e) {
            return arguments.length ? (typeof e == "function" ? a = s = e : a = (s = eo.get(e) || an).key, t) : a
        }, t.tension = function (e) {
            return arguments.length ? (f = e, t) : f
        }, t
    }

    function on(e) {
        return e[0]
    }

    function un(e) {
        return e[1]
    }

    function an(e) {
        return e.join("L")
    }

    function fn(e) {
        return an(e) + "Z"
    }

    function ln(e) {
        var t = 0,
            n = e.length,
            r = e[0],
            i = [r[0], ",", r[1]];
        while (++t < n) i.push("V", (r = e[t])[1], "H", r[0]);
        return i.join("")
    }

    function cn(e) {
        var t = 0,
            n = e.length,
            r = e[0],
            i = [r[0], ",", r[1]];
        while (++t < n) i.push("H", (r = e[t])[0], "V", r[1]);
        return i.join("")
    }

    function hn(e, t) {
        return e.length < 4 ? an(e) : e[1] + vn(e.slice(1, e.length - 1), mn(e, t))
    }

    function pn(e, t) {
        return e.length < 3 ? an(e) : e[0] + vn((e.push(e[0]), e), mn([e[e.length - 2]].concat(e, [e[1]]), t))
    }

    function dn(e, t, n) {
        return e.length < 3 ? an(e) : e[0] + vn(e, mn(e, t))
    }

    function vn(e, t) {
        if (t.length < 1 || e.length != t.length && e.length != t.length + 2) return an(e);
        var n = e.length != t.length,
            r = "",
            i = e[0],
            s = e[1],
            o = t[0],
            u = o,
            a = 1;
        n && (r += "Q" + (s[0] - o[0] * 2 / 3) + "," + (s[1] - o[1] * 2 / 3) + "," + s[0] + "," + s[1], i = e[1], a = 2);
        if (t.length > 1) {
            u = t[1], s = e[a], a++, r += "C" + (i[0] + o[0]) + "," + (i[1] + o[1]) + "," + (s[0] - u[0]) + "," + (s[1] - u[1]) + "," + s[0] + "," + s[1];
            for (var f = 2; f < t.length; f++, a++) s = e[a], u = t[f], r += "S" + (s[0] - u[0]) + "," + (s[1] - u[1]) + "," + s[0] + "," + s[1]
        }
        if (n) {
            var l = e[a];
            r += "Q" + (s[0] + u[0] * 2 / 3) + "," + (s[1] + u[1] * 2 / 3) + "," + l[0] + "," + l[1]
        }
        return r
    }

    function mn(e, t) {
        var n = [],
            r = (1 - t) / 2,
            i, s = e[0],
            o = e[1],
            u = 1,
            a = e.length;
        while (++u < a) i = s, s = o, o = e[u], n.push([r * (o[0] - i[0]), r * (o[1] - i[1])]);
        return n
    }

    function gn(e) {
        if (e.length < 3) return an(e);
        var t = 1,
            n = e.length,
            r = e[0],
            i = r[0],
            s = r[1],
            o = [i, i, i, (r = e[1])[0]],
            u = [s, s, s, r[1]],
            a = [i, ",", s];
        Sn(a, o, u);
        while (++t < n) r = e[t], o.shift(), o.push(r[0]), u.shift(), u.push(r[1]), Sn(a, o, u);
        t = -1;
        while (++t < 2) o.shift(), o.push(r[0]), u.shift(), u.push(r[1]), Sn(a, o, u);
        return a.join("")
    }

    function yn(e) {
        if (e.length < 4) return an(e);
        var t = [],
            n = -1,
            r = e.length,
            i, s = [0],
            o = [0];
        while (++n < 3) i = e[n], s.push(i[0]), o.push(i[1]);
        t.push(En(ro, s) + "," + En(ro, o)), --n;
        while (++n < r) i = e[n], s.shift(), s.push(i[0]), o.shift(), o.push(i[1]), Sn(t, s, o);
        return t.join("")
    }

    function bn(e) {
        var t, n = -1,
            r = e.length,
            i = r + 4,
            s, o = [],
            u = [];
        while (++n < 4) s = e[n % r], o.push(s[0]), u.push(s[1]);
        t = [En(ro, o), ",", En(ro, u)], --n;
        while (++n < i) s = e[n % r], o.shift(), o.push(s[0]), u.shift(), u.push(s[1]), Sn(t, o, u);
        return t.join("")
    }

    function wn(e, t) {
        var n = e.length - 1;
        if (n) {
            var r = e[0][0],
                i = e[0][1],
                s = e[n][0] - r,
                o = e[n][1] - i,
                u = -1,
                a, f;
            while (++u <= n) a = e[u], f = u / n, a[0] = t * a[0] + (1 - t) * (r + f * s), a[1] = t * a[1] + (1 - t) * (i + f * o)
        }
        return gn(e)
    }

    function En(e, t) {
        return e[0] * t[0] + e[1] * t[1] + e[2] * t[2] + e[3] * t[3]
    }

    function Sn(e, t, n) {
        e.push("C", En(to, t), ",", En(to, n), ",", En(no, t), ",", En(no, n), ",", En(ro, t), ",", En(ro, n))
    }

    function xn(e, t) {
        return (t[1] - e[1]) / (t[0] - e[0])
    }

    function Tn(e) {
        var t = 0,
            n = e.length - 1,
            r = [],
            i = e[0],
            s = e[1],
            o = r[0] = xn(i, s);
        while (++t < n) r[t] = (o + (o = xn(i = s, s = e[t + 1]))) / 2;
        return r[t] = o, r
    }

    function Nn(e) {
        var t = [],
            n, r, i, s, o = Tn(e),
            u = -1,
            a = e.length - 1;
        while (++u < a) n = xn(e[u], e[u + 1]), Math.abs(n) < 1e-6 ? o[u] = o[u + 1] = 0 : (r = o[u] / n, i = o[u + 1] / n, s = r * r + i * i, s > 9 && (s = n * 3 / Math.sqrt(s), o[u] = s * r, o[u + 1] = s * i));
        u = -1;
        while (++u <= a) s = (e[Math.min(a, u + 1)][0] - e[Math.max(0, u - 1)][0]) / (6 * (1 + o[u] * o[u])), t.push([s || 0, o[u] * s || 0]);
        return t
    }

    function Cn(e) {
        return e.length < 3 ? an(e) : e[0] + vn(e, Nn(e))
    }

    function kn(e) {
        var t, n = -1,
            r = e.length,
            i, s;
        while (++n < r) t = e[n], i = t[0], s = t[1] + Ys, t[0] = i * Math.cos(s), t[1] = i * Math.sin(s);
        return e
    }

    function Ln(e) {
        function t(t) {
            function o() {
                l.push("M", f(e(v), p), h, c(e(d.reverse()), p), "Z")
            }
            var l = [],
                d = [],
                v = [],
                m = -1,
                g = t.length,
                y, b = u(n),
                w = u(i),
                E = n === r ? function () {
                    return x
                } : u(r),
                S = i === s ? function () {
                    return T
                } : u(s),
                x, T;
            while (++m < g) a.call(this, y = t[m], m) ? (d.push([x = +b.call(this, y, m), T = +w.call(this, y, m)]), v.push([+E.call(this, y, m), +S.call(this, y, m)])) : d.length && (o(), d = [], v = []);
            return d.length && o(), l.length ? l.join("") : null
        }
        var n = on,
            r = on,
            i = 0,
            s = un,
            a = o,
            f = an,
            l = f.key,
            c = f,
            h = "L",
            p = .7;
        return t.x = function (e) {
            return arguments.length ? (n = r = e, t) : r
        }, t.x0 = function (e) {
            return arguments.length ? (n = e, t) : n
        }, t.x1 = function (e) {
            return arguments.length ? (r = e, t) : r
        }, t.y = function (e) {
            return arguments.length ? (i = s = e, t) : s
        }, t.y0 = function (e) {
            return arguments.length ? (i = e, t) : i
        }, t.y1 = function (e) {
            return arguments.length ? (s = e, t) : s
        }, t.defined = function (e) {
            return arguments.length ? (a = e, t) : a
        },
        t.interpolate = function (e) {
            return arguments.length ? (typeof e == "function" ? l = f = e : l = (f = eo.get(e) || an).key, c = f.reverse || f, h = f.closed ? "M" : "L", t) : l
        }, t.tension = function (e) {
            return arguments.length ? (p = e, t) : p
        }, t
    }

    function An(e) {
        return e.source
    }

    function On(e) {
        return e.target
    }

    function Mn(e) {
        return e.radius
    }

    function _n(e) {
        return e.startAngle
    }

    function Dn(e) {
        return e.endAngle
    }

    function Pn(e) {
        return [e.x, e.y]
    }

    function Hn(e) {
        return function () {
            var t = e.apply(this, arguments),
                n = t[0],
                r = t[1] + Ys;
            return [n * Math.cos(r), n * Math.sin(r)]
        }
    }

    function Bn() {
        return 64
    }

    function jn() {
        return "circle"
    }

    function Fn(e) {
        var t = Math.sqrt(e / Math.PI);
        return "M0," + t + "A" + t + "," + t + " 0 1,1 0," + -t + "A" + t + "," + t + " 0 1,1 0," + t + "Z"
    }

    function In(e, t) {
        e.attr("transform", function (e) {
            return "translate(" + t(e) + ",0)"
        })
    }

    function qn(e, t) {
        e.attr("transform", function (e) {
            return "translate(0," + t(e) + ")"
        })
    }

    function Rn(e, t, n) {
        i = [];
        if (n && t.length > 1) {
            var r = _t(e.domain()),
                i, s = -1,
                o = t.length,
                u = (t[1] - t[0]) / ++n,
                a, f;
            while (++s < o)
                for (a = n; --a > 0;)(f = +t[s] - a * u) >= r[0] && i.push(f);
            for (--s, a = 0; ++a < n && (f = +t[s] + a * u) < r[1];) i.push(f)
        }
        return i
    }

    function Un() {
        fo || (fo = d3.select("body").append("div").style("visibility", "hidden").style("top", 0).style("height", 0).style("width", 0).style("overflow-y", "scroll").append("div").style("height", "2000px").node().parentNode);
        var e = d3.event,
            t;
        try {
            fo.scrollTop = 1e3, fo.dispatchEvent(e), t = 1e3 - fo.scrollTop
        } catch (n) {
            t = e.wheelDelta || -e.detail * 5
        }
        return t
    }

    function zn(e) {
        var t = e.source,
            n = e.target,
            r = Xn(t, n),
            i = [t];
        while (t !== r) t = t.parent, i.push(t);
        var s = i.length;
        while (n !== r) i.splice(s, 0, n), n = n.parent;
        return i
    }

    function Wn(e) {
        var t = [],
            n = e.parent;
        while (n != null) t.push(e), e = n, n = n.parent;
        return t.push(e), t
    }

    function Xn(e, t) {
        if (e === t) return e;
        var n = Wn(e),
            r = Wn(t),
            i = n.pop(),
            s = r.pop(),
            o = null;
        while (i === s) o = i, i = n.pop(), s = r.pop();
        return o
    }

    function Vn(e) {
        e.fixed |= 2
    }

    function $n(e) {
        e.fixed &= 1
    }

    function Jn(e) {
        e.fixed |= 4
    }

    function Kn(e) {
        e.fixed &= 3
    }

    function Qn(e, t, n) {
        var r = 0,
            i = 0;
        e.charge = 0;
        if (!e.leaf) {
            var s = e.nodes,
                o = s.length,
                u = -1,
                a;
            while (++u < o) {
                a = s[u];
                if (a == null) continue;
                Qn(a, t, n), e.charge += a.charge, r += a.charge * a.cx, i += a.charge * a.cy
            }
        }
        if (e.point) {
            e.leaf || (e.point.x += Math.random() - .5, e.point.y += Math.random() - .5);
            var f = t * n[e.point.index];
            e.charge += e.pointCharge = f, r += f * e.point.x, i += f * e.point.y
        }
        e.cx = r / e.charge, e.cy = i / e.charge
    }

    function Gn(e) {
        return 20
    }

    function Yn(e) {
        return 1
    }

    function Zn(e) {
        return e.x
    }

    function er(e) {
        return e.y
    }

    function tr(e, t, n) {
        e.y0 = t, e.y = n
    }

    function nr(e) {
        return d3.range(e.length)
    }

    function rr(e) {
        var t = -1,
            n = e[0].length,
            r = [];
        while (++t < n) r[t] = 0;
        return r
    }

    function ir(e) {
        var t = 1,
            n = 0,
            r = e[0][1],
            i, s = e.length;
        for (; t < s; ++t)(i = e[t][1]) > r && (n = t, r = i);
        return n
    }

    function sr(e) {
        return e.reduce(or, 0)
    }

    function or(e, t) {
        return e + t[1]
    }

    function ur(e, t) {
        return ar(e, Math.ceil(Math.log(t.length) / Math.LN2 + 1))
    }

    function ar(e, t) {
        var n = -1,
            r = +e[0],
            i = (e[1] - r) / t,
            s = [];
        while (++n <= t) s[n] = i * n + r;
        return s
    }

    function fr(e) {
        return [d3.min(e), d3.max(e)]
    }

    function lr(e, t) {
        return d3.rebind(e, t, "sort", "children", "value"), e.links = dr, e.nodes = function (t) {
            return vo = !0, (e.nodes = e)(t)
        }, e
    }

    function cr(e) {
        return e.children
    }

    function hr(e) {
        return e.value
    }

    function pr(e, t) {
        return t.value - e.value
    }

    function dr(e) {
        return d3.merge(e.map(function (e) {
            return (e.children || []).map(function (t) {
                return {
                    source: e,
                    target: t
                }
            })
        }))
    }

    function vr(e, t) {
        return e.value - t.value
    }

    function mr(e, t) {
        var n = e._pack_next;
        e._pack_next = t, t._pack_prev = e, t._pack_next = n, n._pack_prev = t
    }

    function gr(e, t) {
        e._pack_next = t, t._pack_prev = e
    }

    function yr(e, t) {
        var n = t.x - e.x,
            r = t.y - e.y,
            i = e.r + t.r;
        return i * i - n * n - r * r > .001
    }

    function br(e) {
        function t(e) {
            r = Math.min(e.x - e.r, r), i = Math.max(e.x + e.r, i), s = Math.min(e.y - e.r, s), o = Math.max(e.y + e.r, o)
        }
        if (!(n = e.children) || !(p = n.length)) return;
        var n, r = Infinity,
            i = -Infinity,
            s = Infinity,
            o = -Infinity,
            u, a, f, l, c, h, p;
        n.forEach(wr), u = n[0], u.x = -u.r, u.y = 0, t(u);
        if (p > 1) {
            a = n[1], a.x = a.r, a.y = 0, t(a);
            if (p > 2) {
                f = n[2], xr(u, a, f), t(f), mr(u, f), u._pack_prev = f, mr(f, a), a = u._pack_next;
                for (l = 3; l < p; l++) {
                    xr(u, a, f = n[l]);
                    var d = 0,
                        v = 1,
                        m = 1;
                    for (c = a._pack_next; c !== a; c = c._pack_next, v++)
                        if (yr(c, f)) {
                            d = 1;
                            break
                        }
                    if (d == 1)
                        for (h = u._pack_prev; h !== c._pack_prev; h = h._pack_prev, m++)
                            if (yr(h, f)) break;
                    d ? (v < m || v == m && a.r < u.r ? gr(u, a = c) : gr(u = h, a), l--) : (mr(u, f), a = f, t(f))
                }
            }
        }
        var g = (r + i) / 2,
            y = (s + o) / 2,
            b = 0;
        for (l = 0; l < p; l++) f = n[l], f.x -= g, f.y -= y, b = Math.max(b, f.r + Math.sqrt(f.x * f.x + f.y * f.y));
        e.r = b, n.forEach(Er)
    }

    function wr(e) {
        e._pack_next = e._pack_prev = e
    }

    function Er(e) {
        delete e._pack_next, delete e._pack_prev
    }

    function Sr(e, t, n, r) {
        var i = e.children;
        e.x = t += r * e.x, e.y = n += r * e.y, e.r *= r;
        if (i) {
            var s = -1,
                o = i.length;
            while (++s < o) Sr(i[s], t, n, r)
        }
    }

    function xr(e, t, n) {
        var r = e.r + n.r,
            i = t.x - e.x,
            s = t.y - e.y;
        if (r && (i || s)) {
            var o = t.r + n.r,
                u = i * i + s * s;
            o *= o, r *= r;
            var a = .5 + (r - o) / (2 * u),
                f = Math.sqrt(Math.max(0, 2 * o * (r + u) - (r -= u) * r - o * o)) / (2 * u);
            n.x = e.x + a * i + f * s, n.y = e.y + a * s - f * i
        } else n.x = e.x + r, n.y = e.y
    }

    function Tr(e) {
        return 1 + d3.max(e, function (e) {
            return e.y
        })
    }

    function Nr(e) {
        return e.reduce(function (e, t) {
            return e + t.x
        }, 0) / e.length
    }

    function Cr(e) {
        var t = e.children;
        return t && t.length ? Cr(t[0]) : e
    }

    function kr(e) {
        var t = e.children,
            n;
        return t && (n = t.length) ? kr(t[n - 1]) : e
    }

    function Lr(e, t) {
        return e.parent == t.parent ? 1 : 2
    }

    function Ar(e) {
        var t = e.children;
        return t && t.length ? t[0] : e._tree.thread
    }

    function Or(e) {
        var t = e.children,
            n;
        return t && (n = t.length) ? t[n - 1] : e._tree.thread
    }

    function Mr(e, t) {
        var n = e.children;
        if (n && (i = n.length)) {
            var r, i, s = -1;
            while (++s < i) t(r = Mr(n[s], t), e) > 0 && (e = r)
        }
        return e
    }

    function _r(e, t) {
        return e.x - t.x
    }

    function Dr(e, t) {
        return t.x - e.x
    }

    function Pr(e, t) {
        return e.depth - t.depth
    }

    function Hr(e, t) {
        function n(e, r) {
            var i = e.children;
            if (i && (a = i.length)) {
                var s, o = null,
                    u = -1,
                    a;
                while (++u < a) s = i[u], n(s, o), o = s
            }
            t(e, r)
        }
        n(e, null)
    }

    function Br(e) {
        var t = 0,
            n = 0,
            r = e.children,
            i = r.length,
            s;
        while (--i >= 0) s = r[i]._tree, s.prelim += t, s.mod += t, t += s.shift + (n += s.change)
    }

    function jr(e, t, n) {
        e = e._tree, t = t._tree;
        var r = n / (t.number - e.number);
        e.change += r, t.change -= r, t.shift += n, t.prelim += n, t.mod += n
    }

    function Fr(e, t, n) {
        return e._tree.ancestor.parent == t.parent ? e._tree.ancestor : n
    }

    function Ir(e) {
        return {
            x: e.x,
            y: e.y,
            dx: e.dx,
            dy: e.dy
        }
    }

    function qr(e, t) {
        var n = e.x + t[3],
            r = e.y + t[0],
            i = e.dx - t[1] - t[3],
            s = e.dy - t[0] - t[2];
        return i < 0 && (n += i / 2, i = 0), s < 0 && (r += s / 2, s = 0), {
            x: n,
            y: r,
            dx: i,
            dy: s
        }
    }

    function Rr(e, t) {
        function n(e, r) {
            d3.text(e, t, function (e) {
                r(e && n.parse(e))
            })
        }

        function r(t) {
            return t.map(i).join(e)
        }

        function i(e) {
            return o.test(e) ? '"' + e.replace(/\"/g, '""') + '"' : e
        }
        var s = new RegExp("\r\n|[" + e + "\r\n]", "g"),
            o = new RegExp('["' + e + "\n]"),
            u = e.charCodeAt(0);
        return n.parse = function (e) {
            var t;
            return n.parseRows(e, function (e, n) {
                if (n) {
                    var r = {}, i = -1,
                        s = t.length;
                    while (++i < s) r[t[i]] = e[i];
                    return r
                }
                return t = e, null
            })
        }, n.parseRows = function (e, t) {
            function n() {
                if (s.lastIndex >= e.length) return i;
                if (l) return l = !1, r;
                var t = s.lastIndex;
                if (e.charCodeAt(t) === 34) {
                    var n = t;
                    while (n++ < e.length)
                        if (e.charCodeAt(n) === 34) {
                            if (e.charCodeAt(n + 1) !== 34) break;
                            n++
                        }
                    s.lastIndex = n + 2;
                    var o = e.charCodeAt(n + 1);
                    return o === 13 ? (l = !0, e.charCodeAt(n + 2) === 10 && s.lastIndex++) : o === 10 && (l = !0), e.substring(t + 1, n).replace(/""/g, '"')
                }
                var a = s.exec(e);
                return a ? (l = a[0].charCodeAt(0) !== u, e.substring(t, a.index)) : (s.lastIndex = e.length, e.substring(t))
            }
            var r = {}, i = {}, o = [],
                a = 0,
                f, l;
            s.lastIndex = 0;
            while ((f = n()) !== i) {
                var c = [];
                while (f !== r && f !== i) c.push(f), f = n();
                if (t && !(c = t(c, a++))) continue;
                o.push(c)
            }
            return o
        }, n.format = function (e) {
            return e.map(r).join("\n")
        }, n
    }

    function Ur(e, t) {
        return function (n) {
            return n && e.hasOwnProperty(n.type) ? e[n.type](n) : t
        }
    }

    function zr(e) {
        return "m0," + e + "a" + e + "," + e + " 0 1,1 0," + -2 * e + "a" + e + "," + e + " 0 1,1 0," + 2 * e + "z"
    }

    function Wr(e, t) {
        go.hasOwnProperty(e.type) && go[e.type](e, t)
    }

    function Xr(e, t) {
        Wr(e.geometry, t)
    }

    function Vr(e, t) {
        for (var n = e.features, r = 0, i = n.length; r < i; r++) Wr(n[r].geometry, t)
    }

    function $r(e, t) {
        for (var n = e.geometries, r = 0, i = n.length; r < i; r++) Wr(n[r], t)
    }

    function Jr(e, t) {
        for (var n = e.coordinates, r = 0, i = n.length; r < i; r++) t.apply(null, n[r])
    }

    function Kr(e, t) {
        for (var n = e.coordinates, r = 0, i = n.length; r < i; r++)
            for (var s = n[r], o = 0, u = s.length; o < u; o++) t.apply(null, s[o])
    }

    function Qr(e, t) {
        for (var n = e.coordinates, r = 0, i = n.length; r < i; r++)
            for (var s = n[r][0], o = 0, u = s.length; o < u; o++) t.apply(null, s[o])
    }

    function Gr(e, t) {
        t.apply(null, e.coordinates)
    }

    function Yr(e, t) {
        for (var n = e.coordinates[0], r = 0, i = n.length; r < i; r++) t.apply(null, n[r])
    }

    function Zr(e) {
        return e.source
    }

    function ei(e) {
        return e.target
    }

    function ti() {
        function e(e) {
            var t = Math.sin(e *= p) * d,
                n = Math.sin(p - e) * d,
                r = n * s + t * c,
                u = n * o + t * h,
                a = n * i + t * l;
            return [Math.atan2(u, r) / mo, Math.atan2(a, Math.sqrt(r * r + u * u)) / mo]
        }
        var t, n, r, i, s, o, u, a, f, l, c, h, p, d;
        return e.distance = function () {
            return p == null && (d = 1 / Math.sin(p = Math.acos(Math.max(-1, Math.min(1, i * l + r * f * Math.cos(u - t)))))), p
        }, e.source = function (u) {
            var a = Math.cos(t = u[0] * mo),
                f = Math.sin(t);
            return r = Math.cos(n = u[1] * mo), i = Math.sin(n), s = r * a, o = r * f, p = null, e
        }, e.target = function (t) {
            var n = Math.cos(u = t[0] * mo),
                r = Math.sin(u);
            return f = Math.cos(a = t[1] * mo), l = Math.sin(a), c = f * n, h = f * r, p = null, e
        }, e
    }

    function ni(e, t) {
        var n = ti().source(e).target(t);
        return n.distance(), n
    }

    function ri(e) {
        var t = 0,
            n = 0;
        for (;;) {
            if (e(t, n)) return [t, n];
            t === 0 ? (t = n + 1, n = 0) : (t -= 1, n += 1)
        }
    }

    function ii(e, t, n, r) {
        var i, s, o, u, a, f, l;
        return i = r[e], s = i[0], o = i[1], i = r[t], u = i[0], a = i[1], i = r[n], f = i[0], l = i[1], (l - o) * (u - s) - (a - o) * (f - s) > 0
    }

    function si(e, t, n) {
        return (n[0] - t[0]) * (e[1] - t[1]) < (n[1] - t[1]) * (e[0] - t[0])
    }

    function oi(e, t, n, r) {
        var i = e[0],
            s = t[0],
            o = n[0],
            u = r[0],
            a = e[1],
            f = t[1],
            l = n[1],
            c = r[1],
            h = i - o,
            p = s - i,
            d = u - o,
            v = a - l,
            m = f - a,
            g = c - l,
            y = (d * v - g * h) / (g * p - d * m);
        return [i + y * p, a + y * m]
    }

    function ui(e, t) {
        var n = {
            list: e.map(function (e, t) {
                return {
                    index: t,
                    x: e[0],
                    y: e[1]
                }
            }).sort(function (e, t) {
                return e.y < t.y ? -1 : e.y > t.y ? 1 : e.x < t.x ? -1 : e.x > t.x ? 1 : 0
            }),
            bottomSite: null
        }, r = {
                list: [],
                leftEnd: null,
                rightEnd: null,
                init: function () {
                    r.leftEnd = r.createHalfEdge(null, "l"), r.rightEnd = r.createHalfEdge(null, "l"), r.leftEnd.r = r.rightEnd, r.rightEnd.l = r.leftEnd, r.list.unshift(r.leftEnd, r.rightEnd)
                },
                createHalfEdge: function (e, t) {
                    return {
                        edge: e,
                        side: t,
                        vertex: null,
                        l: null,
                        r: null
                    }
                },
                insert: function (e, t) {
                    t.l = e, t.r = e.r, e.r.l = t, e.r = t
                },
                leftBound: function (e) {
                    var t = r.leftEnd;
                    do t = t.r; while (t != r.rightEnd && i.rightOf(t, e));
                    return t = t.l, t
                },
                del: function (e) {
                    e.l.r = e.r, e.r.l = e.l, e.edge = null
                },
                right: function (e) {
                    return e.r
                },
                left: function (e) {
                    return e.l
                },
                leftRegion: function (e) {
                    return e.edge == null ? n.bottomSite : e.edge.region[e.side]
                },
                rightRegion: function (e) {
                    return e.edge == null ? n.bottomSite : e.edge.region[wo[e.side]]
                }
            }, i = {
                bisect: function (e, t) {
                    var n = {
                        region: {
                            l: e,
                            r: t
                        },
                        ep: {
                            l: null,
                            r: null
                        }
                    }, r = t.x - e.x,
                        i = t.y - e.y,
                        s = r > 0 ? r : -r,
                        o = i > 0 ? i : -i;
                    return n.c = e.x * r + e.y * i + (r * r + i * i) * .5, s > o ? (n.a = 1, n.b = i / r, n.c /= r) : (n.b = 1, n.a = r / i, n.c /= i), n
                },
                intersect: function (e, t) {
                    var n = e.edge,
                        r = t.edge;
                    if (!n || !r || n.region.r == r.region.r) return null;
                    var i = n.a * r.b - n.b * r.a;
                    if (Math.abs(i) < 1e-10) return null;
                    var s = (n.c * r.b - r.c * n.b) / i,
                        o = (r.c * n.a - n.c * r.a) / i,
                        u = n.region.r,
                        a = r.region.r,
                        f, l;
                    u.y < a.y || u.y == a.y && u.x < a.x ? (f = e, l = n) : (f = t, l = r);
                    var c = s >= l.region.r.x;
                    return c && f.side === "l" || !c && f.side === "r" ? null : {
                        x: s,
                        y: o
                    }
                },
                rightOf: function (e, t) {
                    var n = e.edge,
                        r = n.region.r,
                        i = t.x > r.x;
                    if (i && e.side === "l") return 1;
                    if (!i && e.side === "r") return 0;
                    if (n.a === 1) {
                        var s = t.y - r.y,
                            o = t.x - r.x,
                            u = 0,
                            a = 0;
                        !i && n.b < 0 || i && n.b >= 0 ? a = u = s >= n.b * o : (a = t.x + t.y * n.b > n.c, n.b < 0 && (a = !a), a || (u = 1));
                        if (!u) {
                            var f = r.x - n.region.l.x;
                            a = n.b * (o * o - s * s) < f * s * (1 + 2 * o / f + n.b * n.b), n.b < 0 && (a = !a)
                        }
                    } else {
                        var l = n.c - n.a * t.x,
                            c = t.y - l,
                            h = t.x - r.x,
                            p = l - r.y;
                        a = c * c > h * h + p * p
                    }
                    return e.side === "l" ? a : !a
                },
                endPoint: function (e, n, r) {
                    e.ep[n] = r;
                    if (!e.ep[wo[n]]) return;
                    t(e)
                },
                distance: function (e, t) {
                    var n = e.x - t.x,
                        r = e.y - t.y;
                    return Math.sqrt(n * n + r * r)
                }
            }, s = {
                list: [],
                insert: function (e, t, n) {
                    e.vertex = t, e.ystar = t.y + n;
                    for (var r = 0, i = s.list, o = i.length; r < o; r++) {
                        var u = i[r];
                        if (e.ystar > u.ystar || e.ystar == u.ystar && t.x > u.vertex.x) continue;
                        break
                    }
                    i.splice(r, 0, e)
                },
                del: function (e) {
                    for (var t = 0, n = s.list, r = n.length; t < r && n[t] != e; ++t);
                    n.splice(t, 1)
                },
                empty: function () {
                    return s.list.length === 0
                },
                nextEvent: function (e) {
                    for (var t = 0, n = s.list, r = n.length; t < r; ++t)
                        if (n[t] == e) return n[t + 1];
                    return null
                },
                min: function () {
                    var e = s.list[0];
                    return {
                        x: e.vertex.x,
                        y: e.ystar
                    }
                },
                extractMin: function () {
                    return s.list.shift()
                }
            };
        r.init(), n.bottomSite = n.list.shift();
        var o = n.list.shift(),
            u, a, f, l, c, h, p, d, v, m, g, y, b;
        for (;;) {
            s.empty() || (u = s.min());
            if (o && (s.empty() || o.y < u.y || o.y == u.y && o.x < u.x)) a = r.leftBound(o), f = r.right(a), p = r.rightRegion(a), y = i.bisect(p, o), h = r.createHalfEdge(y, "l"), r.insert(a, h), m = i.intersect(a, h), m && (s.del(a), s.insert(a, m, i.distance(m, o))), a = h, h = r.createHalfEdge(y, "r"), r.insert(a, h), m = i.intersect(h, f), m && s.insert(h, m, i.distance(m, o)), o = n.list.shift();
            else {
                if ( !! s.empty()) break;
                a = s.extractMin(), l = r.left(a), f = r.right(a), c = r.right(f), p = r.leftRegion(a), d = r.rightRegion(f), g = a.vertex, i.endPoint(a.edge, a.side, g), i.endPoint(f.edge, f.side, g), r.del(a), s.del(f), r.del(f), b = "l", p.y > d.y && (v = p, p = d, d = v, b = "r"), y = i.bisect(p, d), h = r.createHalfEdge(y, b), r.insert(l, h), i.endPoint(y, wo[b], g), m = i.intersect(l, h), m && (s.del(l), s.insert(l, m, i.distance(m, p))), m = i.intersect(h, c), m && s.insert(h, m, i.distance(m, p))
            }
        }
        for (a = r.right(r.leftEnd); a != r.rightEnd; a = r.right(a)) t(a.edge)
    }

    function ai() {
        return {
            leaf: !0,
            nodes: [],
            point: null
        }
    }

    function fi(e, t, n, r, i, s) {
        if (!e(t, n, r, i, s)) {
            var o = (n + i) * .5,
                u = (r + s) * .5,
                a = t.nodes;
            a[0] && fi(e, a[0], n, r, o, u), a[1] && fi(e, a[1], o, r, i, u), a[2] && fi(e, a[2], n, u, o, s), a[3] && fi(e, a[3], o, u, i, s)
        }
    }

    function li(e) {
        return {
            x: e[0],
            y: e[1]
        }
    }

    function ci() {
        this._ = new Date(arguments.length > 1 ? Date.UTC.apply(this, arguments) : arguments[0])
    }

    function hi(e) {
        return e.substring(0, 3)
    }

    function pi(e, t, n, r) {
        var i, s, o = 0,
            u = t.length,
            a = n.length;
        while (o < u) {
            if (r >= a) return -1;
            i = t.charCodeAt(o++);
            if (i == 37) {
                s = Uo[t.charAt(o++)];
                if (!s || (r = s(e, n, r)) < 0) return -1
            } else if (i != n.charCodeAt(r++)) return -1
        }
        return r
    }

    function di(e) {
        return new RegExp("^(?:" + e.map(d3.requote).join("|") + ")", "i")
    }

    function vi(e) {
        var t = new r,
            n = -1,
            i = e.length;
        while (++n < i) t.set(e[n].toLowerCase(), n);
        return t
    }

    function mi(e, t, n) {
        Bo.lastIndex = 0;
        var r = Bo.exec(t.substring(n));
        return r ? n += r[0].length : -1
    }

    function gi(e, t, n) {
        Ho.lastIndex = 0;
        var r = Ho.exec(t.substring(n));
        return r ? n += r[0].length : -1
    }

    function yi(e, t, n) {
        Io.lastIndex = 0;
        var r = Io.exec(t.substring(n));
        return r ? (e.m = qo.get(r[0].toLowerCase()), n += r[0].length) : -1
    }

    function bi(e, t, n) {
        jo.lastIndex = 0;
        var r = jo.exec(t.substring(n));
        return r ? (e.m = Fo.get(r[0].toLowerCase()), n += r[0].length) : -1
    }

    function wi(e, t, n) {
        return pi(e, Ro.c.toString(), t, n)
    }

    function Ei(e, t, n) {
        return pi(e, Ro.x.toString(), t, n)
    }

    function Si(e, t, n) {
        return pi(e, Ro.X.toString(), t, n)
    }

    function xi(e, t, n) {
        zo.lastIndex = 0;
        var r = zo.exec(t.substring(n, n + 4));
        return r ? (e.y = +r[0], n += r[0].length) : -1
    }

    function Ti(e, t, n) {
        zo.lastIndex = 0;
        var r = zo.exec(t.substring(n, n + 2));
        return r ? (e.y = Ni(+r[0]), n += r[0].length) : -1
    }

    function Ni(e) {
        return e + (e > 68 ? 1900 : 2e3)
    }

    function Ci(e, t, n) {
        zo.lastIndex = 0;
        var r = zo.exec(t.substring(n, n + 2));
        return r ? (e.m = r[0] - 1, n += r[0].length) : -1
    }

    function ki(e, t, n) {
        zo.lastIndex = 0;
        var r = zo.exec(t.substring(n, n + 2));
        return r ? (e.d = +r[0], n += r[0].length) : -1
    }

    function Li(e, t, n) {
        zo.lastIndex = 0;
        var r = zo.exec(t.substring(n, n + 2));
        return r ? (e.H = +r[0], n += r[0].length) : -1
    }

    function Ai(e, t, n) {
        zo.lastIndex = 0;
        var r = zo.exec(t.substring(n, n + 2));
        return r ? (e.M = +r[0], n += r[0].length) : -1
    }

    function Oi(e, t, n) {
        zo.lastIndex = 0;
        var r = zo.exec(t.substring(n, n + 2));
        return r ? (e.S = +r[0], n += r[0].length) : -1
    }

    function Mi(e, t, n) {
        zo.lastIndex = 0;
        var r = zo.exec(t.substring(n, n + 3));
        return r ? (e.L = +r[0], n += r[0].length) : -1
    }

    function _i(e, t, n) {
        var r = Wo.get(t.substring(n, n += 2).toLowerCase());
        return r == null ? -1 : (e.p = r, n)
    }

    function Di(e) {
        var t = e.getTimezoneOffset(),
            n = t > 0 ? "-" : "+",
            r = ~~ (Math.abs(t) / 60),
            i = Math.abs(t) % 60;
        return n + Mo(r) + Mo(i)
    }

    function Pi(e) {
        return e.toISOString()
    }

    function Hi(e, t, n) {
        function r(t) {
            var n = e(t),
                r = s(n, 1);
            return t - n < r - t ? n : r
        }

        function i(n) {
            return t(n = e(new Eo(n - 1)), 1), n
        }

        function s(e, n) {
            return t(e = new Eo(+e), n), e
        }

        function o(e, r, s) {
            var o = i(e),
                u = [];
            if (s > 1)
                while (o < r) n(o) % s || u.push(new Date(+o)), t(o, 1);
            else
                while (o < r) u.push(new Date(+o)), t(o, 1);
            return u
        }

        function u(e, t, n) {
            try {
                Eo = ci;
                var r = new ci;
                return r._ = e, o(r, t, n)
            } finally {
                Eo = Date
            }
        }
        e.floor = e, e.round = r, e.ceil = i, e.offset = s, e.range = o;
        var a = e.utc = Bi(e);
        return a.floor = a, a.round = Bi(r), a.ceil = Bi(i), a.offset = Bi(s), a.range = u, e
    }

    function Bi(e) {
        return function (t, n) {
            try {
                Eo = ci;
                var r = new ci;
                return r._ = t, e(r, n)._
            } finally {
                Eo = Date
            }
        }
    }

    function ji(e, t, n) {
        function r(t) {
            return e(t)
        }
        return r.invert = function (t) {
            return Ii(e.invert(t))
        }, r.domain = function (t) {
            return arguments.length ? (e.domain(t), r) : e.domain().map(Ii)
        }, r.nice = function (e) {
            return r.domain(Pt(r.domain(), function () {
                return e
            }))
        }, r.ticks = function (n, i) {
            var s = Fi(r.domain());
            if (typeof n != "function") {
                var o = s[1] - s[0],
                    u = o / n,
                    a = d3.bisect(Vo, u);
                if (a == Vo.length) return t.year(s, n);
                if (!a) return e.ticks(n).map(Ii);
                Math.log(u / Vo[a - 1]) < Math.log(Vo[a] / u) && --a, n = t[a], i = n[1], n = n[0].range
            }
            return n(s[0], new Date(+s[1] + 1), i)
        }, r.tickFormat = function () {
            return n
        }, r.copy = function () {
            return ji(e.copy(), t, n)
        }, d3.rebind(r, e, "range", "rangeRound", "interpolate", "clamp")
    }

    function Fi(e) {
        var t = e[0],
            n = e[e.length - 1];
        return t < n ? [t, n] : [n, t]
    }

    function Ii(e) {
        return new Date(e)
    }

    function qi(e) {
        return function (t) {
            var n = e.length - 1,
                r = e[n];
            while (!r[1](t)) r = e[--n];
            return r[0](t)
        }
    }

    function Ri(e) {
        var t = new Date(e, 0, 1);
        return t.setFullYear(e), t
    }

    function Ui(e) {
        var t = e.getFullYear(),
            n = Ri(t),
            r = Ri(t + 1);
        return t + (e - n) / (r - n)
    }

    function zi(e) {
        var t = new Date(Date.UTC(e, 0, 1));
        return t.setUTCFullYear(e), t
    }

    function Wi(e) {
        var t = e.getUTCFullYear(),
            n = zi(t),
            r = zi(t + 1);
        return t + (e - n) / (r - n)
    }
    Date.now || (Date.now = function () {
        return +(new Date)
    });
    try {
        document.createElement("div").style.setProperty("opacity", 0, "")
    } catch (Xi) {
        var Vi = CSSStyleDeclaration.prototype,
            $i = Vi.setProperty;
        Vi.setProperty = function (e, t, n) {
            $i.call(this, e, t + "", n)
        }
    }
    d3 = {
        version: "2.10.3"
    };
    var Ji = n;
    try {
        Ji(document.documentElement.childNodes)[0].nodeType
    } catch (Ki) {
        Ji = t
    }
    var Qi = [].__proto__ ? function (e, t) {
            e.__proto__ = t
        } : function (e, t) {
            for (var n in t) e[n] = t[n]
        };
    d3.map = function (e) {
        var t = new r;
        for (var n in e) t.set(n, e[n]);
        return t
    }, e(r, {
        has: function (e) {
            return Gi + e in this
        },
        get: function (e) {
            return this[Gi + e]
        },
        set: function (e, t) {
            return this[Gi + e] = t
        },
        remove: function (e) {
            return e = Gi + e, e in this && delete this[e]
        },
        keys: function () {
            var e = [];
            return this.forEach(function (t) {
                e.push(t)
            }), e
        },
        values: function () {
            var e = [];
            return this.forEach(function (t, n) {
                e.push(n)
            }), e
        },
        entries: function () {
            var e = [];
            return this.forEach(function (t, n) {
                e.push({
                    key: t,
                    value: n
                })
            }), e
        },
        forEach: function (e) {
            for (var t in this) t.charCodeAt(0) === Yi && e.call(this, t.substring(1), this[t])
        }
    });
    var Gi = "\0",
        Yi = Gi.charCodeAt(0);
    d3.functor = u, d3.rebind = function (e, t) {
        var n = 1,
            r = arguments.length,
            i;
        while (++n < r) e[i = arguments[n]] = a(e, t, t[i]);
        return e
    }, d3.ascending = function (e, t) {
        return e < t ? -1 : e > t ? 1 : e >= t ? 0 : NaN
    }, d3.descending = function (e, t) {
        return t < e ? -1 : t > e ? 1 : t >= e ? 0 : NaN
    }, d3.mean = function (e, t) {
        var n = e.length,
            r, i = 0,
            s = -1,
            o = 0;
        if (arguments.length === 1)
            while (++s < n) f(r = e[s]) && (i += (r - i) / ++o);
        else
            while (++s < n) f(r = t.call(e, e[s], s)) && (i += (r - i) / ++o);
        return o ? i : undefined
    }, d3.median = function (e, t) {
        return arguments.length > 1 && (e = e.map(t)), e = e.filter(f), e.length ? d3.quantile(e.sort(d3.ascending), .5) : undefined
    }, d3.min = function (e, t) {
        var n = -1,
            r = e.length,
            i, s;
        if (arguments.length === 1) {
            while (++n < r && ((i = e[n]) == null || i != i)) i = undefined;
            while (++n < r)(s = e[n]) != null && i > s && (i = s)
        } else {
            while (++n < r && ((i = t.call(e, e[n], n)) == null || i != i)) i = undefined;
            while (++n < r)(s = t.call(e, e[n], n)) != null && i > s && (i = s)
        }
        return i
    }, d3.max = function (e, t) {
        var n = -1,
            r = e.length,
            i, s;
        if (arguments.length === 1) {
            while (++n < r && ((i = e[n]) == null || i != i)) i = undefined;
            while (++n < r)(s = e[n]) != null && s > i && (i = s)
        } else {
            while (++n < r && ((i = t.call(e, e[n], n)) == null || i != i)) i = undefined;
            while (++n < r)(s = t.call(e, e[n], n)) != null && s > i && (i = s)
        }
        return i
    }, d3.extent = function (e, t) {
        var n = -1,
            r = e.length,
            i, s, o;
        if (arguments.length === 1) {
            while (++n < r && ((i = o = e[n]) == null || i != i)) i = o = undefined;
            while (++n < r)(s = e[n]) != null && (i > s && (i = s), o < s && (o = s))
        } else {
            while (++n < r && ((i = o = t.call(e, e[n], n)) == null || i != i)) i = undefined;
            while (++n < r)(s = t.call(e, e[n], n)) != null && (i > s && (i = s), o < s && (o = s))
        }
        return [i, o]
    }, d3.random = {
        normal: function (e, t) {
            var n = arguments.length;
            return n < 2 && (t = 1), n < 1 && (e = 0),
            function () {
                var n, r, i;
                do n = Math.random() * 2 - 1, r = Math.random() * 2 - 1, i = n * n + r * r; while (!i || i > 1);
                return e + t * n * Math.sqrt(-2 * Math.log(i) / i)
            }
        },
        logNormal: function (e, t) {
            var n = arguments.length;
            n < 2 && (t = 1), n < 1 && (e = 0);
            var r = d3.random.normal();
            return function () {
                return Math.exp(e + t * r())
            }
        },
        irwinHall: function (e) {
            return function () {
                for (var t = 0, n = 0; n < e; n++) t += Math.random();
                return t / e
            }
        }
    }, d3.sum = function (e, t) {
        var n = 0,
            r = e.length,
            i, s = -1;
        if (arguments.length === 1)
            while (++s < r) isNaN(i = +e[s]) || (n += i);
        else
            while (++s < r) isNaN(i = +t.call(e, e[s], s)) || (n += i);
        return n
    }, d3.quantile = function (e, t) {
        var n = (e.length - 1) * t + 1,
            r = Math.floor(n),
            i = e[r - 1],
            s = n - r;
        return s ? i + s * (e[r] - i) : i
    }, d3.transpose = function (e) {
        return d3.zip.apply(d3, e)
    }, d3.zip = function () {
        if (!(i = arguments.length)) return [];
        for (var e = -1, t = d3.min(arguments, l), n = new Array(t); ++e < t;)
            for (var r = -1, i, s = n[e] = new Array(i); ++r < i;) s[r] = arguments[r][e];
        return n
    }, d3.bisector = function (e) {
        return {
            left: function (t, n, r, i) {
                arguments.length < 3 && (r = 0), arguments.length < 4 && (i = t.length);
                while (r < i) {
                    var s = r + i >>> 1;
                    e.call(t, t[s], s) < n ? r = s + 1 : i = s
                }
                return r
            },
            right: function (t, n, r, i) {
                arguments.length < 3 && (r = 0), arguments.length < 4 && (i = t.length);
                while (r < i) {
                    var s = r + i >>> 1;
                    n < e.call(t, t[s], s) ? i = s : r = s + 1
                }
                return r
            }
        }
    };
    var Zi = d3.bisector(function (e) {
        return e
    });
    d3.bisectLeft = Zi.left, d3.bisect = d3.bisectRight = Zi.right, d3.first = function (e, t) {
        var n = 0,
            r = e.length,
            i = e[0],
            s;
        arguments.length === 1 && (t = d3.ascending);
        while (++n < r) t.call(e, i, s = e[n]) > 0 && (i = s);
        return i
    }, d3.last = function (e, t) {
        var n = 0,
            r = e.length,
            i = e[0],
            s;
        arguments.length === 1 && (t = d3.ascending);
        while (++n < r) t.call(e, i, s = e[n]) <= 0 && (i = s);
        return i
    }, d3.nest = function () {
        function e(t, s) {
            if (s >= i.length) return u ? u.call(n, t) : o ? t.sort(o) : t;
            var a = -1,
                f = t.length,
                l = i[s++],
                c, h, p = new r,
                d, v = {};
            while (++a < f)(d = p.get(c = l(h = t[a]))) ? d.push(h) : p.set(c, [h]);
            return p.forEach(function (t, n) {
                v[t] = e(n, s)
            }), v
        }

        function t(e, n) {
            if (n >= i.length) return e;
            var r = [],
                o = s[n++],
                u;
            for (u in e) r.push({
                key: u,
                values: t(e[u], n)
            });
            return o && r.sort(function (e, t) {
                return o(e.key, t.key)
            }), r
        }
        var n = {}, i = [],
            s = [],
            o, u;
        return n.map = function (t) {
            return e(t, 0)
        }, n.entries = function (n) {
            return t(e(n, 0), 0)
        }, n.key = function (e) {
            return i.push(e), n
        }, n.sortKeys = function (e) {
            return s[i.length - 1] = e, n
        }, n.sortValues = function (e) {
            return o = e, n
        }, n.rollup = function (e) {
            return u = e, n
        }, n
    }, d3.keys = function (e) {
        var t = [];
        for (var n in e) t.push(n);
        return t
    }, d3.values = function (e) {
        var t = [];
        for (var n in e) t.push(e[n]);
        return t
    }, d3.entries = function (e) {
        var t = [];
        for (var n in e) t.push({
            key: n,
            value: e[n]
        });
        return t
    }, d3.permute = function (e, t) {
        var n = [],
            r = -1,
            i = t.length;
        while (++r < i) n[r] = e[t[r]];
        return n
    }, d3.merge = function (e) {
        return Array.prototype.concat.apply([], e)
    }, d3.split = function (e, t) {
        var n = [],
            r = [],
            i, s = -1,
            o = e.length;
        arguments.length < 2 && (t = c);
        while (++s < o) t.call(r, i = e[s], s) ? r = [] : (r.length || n.push(r), r.push(i));
        return n
    }, d3.range = function (e, t, n) {
        arguments.length < 3 && (n = 1, arguments.length < 2 && (t = e, e = 0));
        if ((t - e) / n === Infinity) throw new Error("infinite range");
        var r = [],
            i = p(Math.abs(n)),
            s = -1,
            o;
        e *= i, t *= i, n *= i;
        if (n < 0)
            while ((o = e + n * ++s) > t) r.push(o / i);
        else
            while ((o = e + n * ++s) < t) r.push(o / i);
        return r
    }, d3.requote = function (e) {
        return e.replace(es, "\\$&")
    };
    var es = /[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g;
    d3.round = function (e, t) {
        return t ? Math.round(e * (t = Math.pow(10, t))) / t : Math.round(e)
    }, d3.xhr = function (e, t, n) {
        var r = new XMLHttpRequest;
        arguments.length < 3 ? (n = t, t = null) : t && r.overrideMimeType && r.overrideMimeType(t), r.open("GET", e, !0), t && r.setRequestHeader("Accept", t), r.onreadystatechange = function () {
            if (r.readyState === 4) {
                var e = r.status;
                n(!e && r.response || e >= 200 && e < 300 || e === 304 ? r : null)
            }
        }, r.send(null)
    }, d3.text = function (e, t, n) {
        function r(e) {
            n(e && e.responseText)
        }
        arguments.length < 3 && (n = t, t = null), d3.xhr(e, t, r)
    }, d3.json = function (e, t) {
        d3.text(e, "application/json", function (e) {
            t(e ? JSON.parse(e) : null)
        })
    }, d3.html = function (e, t) {
        d3.text(e, "text/html", function (e) {
            if (e != null) {
                var n = document.createRange();
                n.selectNode(document.body), e = n.createContextualFragment(e)
            }
            t(e)
        })
    }, d3.xml = function (e, t, n) {
        function r(e) {
            n(e && e.responseXML)
        }
        arguments.length < 3 && (n = t, t = null), d3.xhr(e, t, r)
    };
    var ts = {
        svg: "http://www.w3.org/2000/svg",
        xhtml: "http://www.w3.org/1999/xhtml",
        xlink: "http://www.w3.org/1999/xlink",
        xml: "http://www.w3.org/XML/1998/namespace",
        xmlns: "http://www.w3.org/2000/xmlns/"
    };
    d3.ns = {
        prefix: ts,
        qualify: function (e) {
            var t = e.indexOf(":"),
                n = e;
            return t >= 0 && (n = e.substring(0, t), e = e.substring(t + 1)), ts.hasOwnProperty(n) ? {
                space: ts[n],
                local: e
            } : e
        }
    }, d3.dispatch = function () {
        var e = new d,
            t = -1,
            n = arguments.length;
        while (++t < n) e[arguments[t]] = v(e);
        return e
    }, d.prototype.on = function (e, t) {
        var n = e.indexOf("."),
            r = "";
        return n > 0 && (r = e.substring(n + 1), e = e.substring(0, n)), arguments.length < 2 ? this[e].on(r) : this[e].on(r, t)
    }, d3.format = function (e) {
        var t = ns.exec(e),
            n = t[1] || " ",
            r = t[3] || "",
            i = t[5],
            s = +t[6],
            o = t[7],
            u = t[8],
            a = t[9],
            f = 1,
            l = "",
            c = !1;
        u && (u = +u.substring(1)), i && (n = "0", o && (s -= Math.floor((s - 1) / 4)));
        switch (a) {
        case "n":
            o = !0, a = "g";
            break;
        case "%":
            f = 100, l = "%", a = "f";
            break;
        case "p":
            f = 100, l = "%", a = "r";
            break;
        case "d":
            c = !0, u = 0;
            break;
        case "s":
            f = -1, a = "r"
        }
        return a == "r" && !u && (a = "g"), a = rs.get(a) || g,
        function (e) {
            if (c && e % 1) return "";
            var t = e < 0 && (e = -e) ? "-" : r;
            if (f < 0) {
                var h = d3.formatPrefix(e, u);
                e = h.scale(e), l = h.symbol
            } else e *= f;
            e = a(e, u);
            if (i) {
                var p = e.length + t.length;
                p < s && (e = (new Array(s - p + 1)).join(n) + e), o && (e = y(e)), e = t + e
            } else {
                o && (e = y(e)), e = t + e;
                var p = e.length;
                p < s && (e = (new Array(s - p + 1)).join(n) + e)
            }
            return e + l
        }
    };
    var ns = /(?:([^{])?([<>=^]))?([+\- ])?(#)?(0)?([0-9]+)?(,)?(\.[0-9]+)?([a-zA-Z%])?/,
        rs = d3.map({
            g: function (e, t) {
                return e.toPrecision(t)
            },
            e: function (e, t) {
                return e.toExponential(t)
            },
            f: function (e, t) {
                return e.toFixed(t)
            },
            r: function (e, t) {
                return d3.round(e, t = m(e, t)).toFixed(Math.max(0, Math.min(20, t)))
            }
        }),
        is = ["y", "z", "a", "f", "p", "n", "Î¼", "m", "", "k", "M", "G", "T", "P", "E", "Z", "Y"].map(b);
    d3.formatPrefix = function (e, t) {
        var n = 0;
        return e && (e < 0 && (e *= -1), t && (e = d3.round(e, m(e, t))), n = 1 + Math.floor(1e-12 + Math.log(e) / Math.LN10), n = Math.max(-24, Math.min(24, Math.floor((n <= 0 ? n + 1 : n - 1) / 3) * 3))), is[8 + n / 3]
    };
    var ss = T(2),
        os = T(3),
        us = function () {
            return x
        }, as = d3.map({
            linear: us,
            poly: T,
            quad: function () {
                return ss
            },
            cubic: function () {
                return os
            },
            sin: function () {
                return N
            },
            exp: function () {
                return C
            },
            circle: function () {
                return k
            },
            elastic: L,
            back: A,
            bounce: function () {
                return O
            }
        }),
        fs = d3.map({
            "in": x,
            out: E,
            "in-out": S,
            "out-in": function (e) {
                return S(E(e))
            }
        });
    d3.ease = function (e) {
        var t = e.indexOf("-"),
            n = t >= 0 ? e.substring(0, t) : e,
            r = t >= 0 ? e.substring(t + 1) : "in";
        return n = as.get(n) || us, r = fs.get(r) || x, w(r(n.apply(null, Array.prototype.slice.call(arguments, 1))))
    }, d3.event = null, d3.transform = function (e) {
        var t = document.createElementNS(d3.ns.prefix.svg, "g");
        return (d3.transform = function (e) {
            t.setAttribute("transform", e);
            var n = t.transform.baseVal.consolidate();
            return new P(n ? n.matrix : cs)
        })(e)
    }, P.prototype.toString = function () {
        return "translate(" + this.translate + ")rotate(" + this.rotate + ")skewX(" + this.skew + ")scale(" + this.scale + ")"
    };
    var ls = 180 / Math.PI,
        cs = {
            a: 1,
            b: 0,
            c: 0,
            d: 1,
            e: 0,
            f: 0
        };
    d3.interpolate = function (e, t) {
        var n = d3.interpolators.length,
            r;
        while (--n >= 0 && !(r = d3.interpolators[n](e, t)));
        return r
    }, d3.interpolateNumber = function (e, t) {
        return t -= e,
        function (n) {
            return e + t * n
        }
    }, d3.interpolateRound = function (e, t) {
        return t -= e,
        function (n) {
            return Math.round(e + t * n)
        }
    }, d3.interpolateString = function (e, t) {
        var n, r, i, s = 0,
            o = 0,
            u = [],
            a = [],
            f, l;
        hs.lastIndex = 0;
        for (r = 0; n = hs.exec(t); ++r) n.index && u.push(t.substring(s, o = n.index)), a.push({
            i: u.length,
            x: n[0]
        }), u.push(null), s = hs.lastIndex;
        s < t.length && u.push(t.substring(s));
        for (r = 0, f = a.length;
            (n = hs.exec(e)) && r < f; ++r) {
            l = a[r];
            if (l.x == n[0]) {
                if (l.i)
                    if (u[l.i + 1] == null) {
                        u[l.i - 1] += l.x, u.splice(l.i, 1);
                        for (i = r + 1; i < f; ++i) a[i].i--
                    } else {
                        u[l.i - 1] += l.x + u[l.i + 1], u.splice(l.i, 2);
                        for (i = r + 1; i < f; ++i) a[i].i -= 2
                    } else if (u[l.i + 1] == null) u[l.i] = l.x;
                else {
                    u[l.i] = l.x + u[l.i + 1], u.splice(l.i + 1, 1);
                    for (i = r + 1; i < f; ++i) a[i].i--
                }
                a.splice(r, 1), f--, r--
            } else l.x = d3.interpolateNumber(parseFloat(n[0]), parseFloat(l.x))
        }
        while (r < f) l = a.pop(), u[l.i + 1] == null ? u[l.i] = l.x : (u[l.i] = l.x + u[l.i + 1], u.splice(l.i + 1, 1)), f--;
        return u.length === 1 ? u[0] == null ? a[0].x : function () {
            return t
        } : function (e) {
            for (r = 0; r < f; ++r) u[(l = a[r]).i] = l.x(e);
            return u.join("")
        }
    }, d3.interpolateTransform = function (e, t) {
        var n = [],
            r = [],
            i, s = d3.transform(e),
            o = d3.transform(t),
            u = s.translate,
            a = o.translate,
            f = s.rotate,
            l = o.rotate,
            c = s.skew,
            h = o.skew,
            p = s.scale,
            d = o.scale;
        return u[0] != a[0] || u[1] != a[1] ? (n.push("translate(", null, ",", null, ")"), r.push({
            i: 1,
            x: d3.interpolateNumber(u[0], a[0])
        }, {
            i: 3,
            x: d3.interpolateNumber(u[1], a[1])
        })) : a[0] || a[1] ? n.push("translate(" + a + ")") : n.push(""), f != l ? (f - l > 180 ? l += 360 : l - f > 180 && (f += 360), r.push({
            i: n.push(n.pop() + "rotate(", null, ")") - 2,
            x: d3.interpolateNumber(f, l)
        })) : l && n.push(n.pop() + "rotate(" + l + ")"), c != h ? r.push({
            i: n.push(n.pop() + "skewX(", null, ")") - 2,
            x: d3.interpolateNumber(c, h)
        }) : h && n.push(n.pop() + "skewX(" + h + ")"), p[0] != d[0] || p[1] != d[1] ? (i = n.push(n.pop() + "scale(", null, ",", null, ")"), r.push({
            i: i - 4,
            x: d3.interpolateNumber(p[0], d[0])
        }, {
            i: i - 2,
            x: d3.interpolateNumber(p[1], d[1])
        })) : (d[0] != 1 || d[1] != 1) && n.push(n.pop() + "scale(" + d + ")"), i = r.length,
        function (e) {
            var t = -1,
                s;
            while (++t < i) n[(s = r[t]).i] = s.x(e);
            return n.join("")
        }
    }, d3.interpolateRgb = function (e, t) {
        e = d3.rgb(e), t = d3.rgb(t);
        var n = e.r,
            r = e.g,
            i = e.b,
            s = t.r - n,
            o = t.g - r,
            u = t.b - i;
        return function (e) {
            return "#" + W(Math.round(n + s * e)) + W(Math.round(r + o * e)) + W(Math.round(i + u * e))
        }
    }, d3.interpolateHsl = function (e, t) {
        e = d3.hsl(e), t = d3.hsl(t);
        var n = e.h,
            r = e.s,
            i = e.l,
            s = t.h - n,
            o = t.s - r,
            u = t.l - i;
        return s > 180 ? s -= 360 : s < -180 && (s += 360),
        function (e) {
            return Y(n + s * e, r + o * e, i + u * e) + ""
        }
    }, d3.interpolateLab = function (e, t) {
        e = d3.lab(e), t = d3.lab(t);
        var n = e.l,
            r = e.a,
            i = e.b,
            s = t.l - n,
            o = t.a - r,
            u = t.b - i;
        return function (e) {
            return it(n + s * e, r + o * e, i + u * e) + ""
        }
    }, d3.interpolateHcl = function (e, t) {
        e = d3.hcl(e), t = d3.hcl(t);
        var n = e.h,
            r = e.c,
            i = e.l,
            s = t.h - n,
            o = t.c - r,
            u = t.l - i;
        return s > 180 ? s -= 360 : s < -180 && (s += 360),
        function (e) {
            return tt(n + s * e, r + o * e, i + u * e) + ""
        }
    }, d3.interpolateArray = function (e, t) {
        var n = [],
            r = [],
            i = e.length,
            s = t.length,
            o = Math.min(e.length, t.length),
            u;
        for (u = 0; u < o; ++u) n.push(d3.interpolate(e[u], t[u]));
        for (; u < i; ++u) r[u] = e[u];
        for (; u < s; ++u) r[u] = t[u];
        return function (e) {
            for (u = 0; u < o; ++u) r[u] = n[u](e);
            return r
        }
    }, d3.interpolateObject = function (e, t) {
        var n = {}, r = {}, i;
        for (i in e) i in t ? n[i] = F(i)(e[i], t[i]) : r[i] = e[i];
        for (i in t) i in e || (r[i] = t[i]);
        return function (e) {
            for (i in n) r[i] = n[i](e);
            return r
        }
    };
    var hs = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g;
    d3.interpolators = [d3.interpolateObject,
        function (e, t) {
            return t instanceof Array && d3.interpolateArray(e, t)
        },
        function (e, t) {
            return (typeof e == "string" || typeof t == "string") && d3.interpolateString(e + "", t + "")
        },
        function (e, t) {
            return (typeof t == "string" ? ds.has(t) || /^(#|rgb\(|hsl\()/.test(t) : t instanceof R) && d3.interpolateRgb(e, t)
        },
        function (e, t) {
            return !isNaN(e = +e) && !isNaN(t = +t) && d3.interpolateNumber(e, t)
        }
    ], R.prototype.toString = function () {
        return this.rgb() + ""
    }, d3.rgb = function (e, t, n) {
        return arguments.length === 1 ? e instanceof z ? U(e.r, e.g, e.b) : X("" + e, U, Y) : U(~~e, ~~t, ~~n)
    };
    var ps = z.prototype = new R;
    ps.brighter = function (e) {
        e = Math.pow(.7, arguments.length ? e : 1);
        var t = this.r,
            n = this.g,
            r = this.b,
            i = 30;
        return !t && !n && !r ? U(i, i, i) : (t && t < i && (t = i), n && n < i && (n = i), r && r < i && (r = i), U(Math.min(255, Math.floor(t / e)), Math.min(255, Math.floor(n / e)), Math.min(255, Math.floor(r / e))))
    }, ps.darker = function (e) {
        return e = Math.pow(.7, arguments.length ? e : 1), U(Math.floor(e * this.r), Math.floor(e * this.g), Math.floor(e * this.b))
    }, ps.hsl = function () {
        return V(this.r, this.g, this.b)
    }, ps.toString = function () {
        return "#" + W(this.r) + W(this.g) + W(this.b)
    };
    var ds = d3.map({
        aliceblue: "#f0f8ff",
        antiquewhite: "#faebd7",
        aqua: "#00ffff",
        aquamarine: "#7fffd4",
        azure: "#f0ffff",
        beige: "#f5f5dc",
        bisque: "#ffe4c4",
        black: "#000000",
        blanchedalmond: "#ffebcd",
        blue: "#0000ff",
        blueviolet: "#8a2be2",
        brown: "#a52a2a",
        burlywood: "#deb887",
        cadetblue: "#5f9ea0",
        chartreuse: "#7fff00",
        chocolate: "#d2691e",
        coral: "#ff7f50",
        cornflowerblue: "#6495ed",
        cornsilk: "#fff8dc",
        crimson: "#dc143c",
        cyan: "#00ffff",
        darkblue: "#00008b",
        darkcyan: "#008b8b",
        darkgoldenrod: "#b8860b",
        darkgray: "#a9a9a9",
        darkgreen: "#006400",
        darkgrey: "#a9a9a9",
        darkkhaki: "#bdb76b",
        darkmagenta: "#8b008b",
        darkolivegreen: "#556b2f",
        darkorange: "#ff8c00",
        darkorchid: "#9932cc",
        darkred: "#8b0000",
        darksalmon: "#e9967a",
        darkseagreen: "#8fbc8f",
        darkslateblue: "#483d8b",
        darkslategray: "#2f4f4f",
        darkslategrey: "#2f4f4f",
        darkturquoise: "#00ced1",
        darkviolet: "#9400d3",
        deeppink: "#ff1493",
        deepskyblue: "#00bfff",
        dimgray: "#696969",
        dimgrey: "#696969",
        dodgerblue: "#1e90ff",
        firebrick: "#b22222",
        floralwhite: "#fffaf0",
        forestgreen: "#228b22",
        fuchsia: "#ff00ff",
        gainsboro: "#dcdcdc",
        ghostwhite: "#f8f8ff",
        gold: "#ffd700",
        goldenrod: "#daa520",
        gray: "#808080",
        green: "#008000",
        greenyellow: "#adff2f",
        grey: "#808080",
        honeydew: "#f0fff0",
        hotpink: "#ff69b4",
        indianred: "#cd5c5c",
        indigo: "#4b0082",
        ivory: "#fffff0",
        khaki: "#f0e68c",
        lavender: "#e6e6fa",
        lavenderblush: "#fff0f5",
        lawngreen: "#7cfc00",
        lemonchiffon: "#fffacd",
        lightblue: "#add8e6",
        lightcoral: "#f08080",
        lightcyan: "#e0ffff",
        lightgoldenrodyellow: "#fafad2",
        lightgray: "#d3d3d3",
        lightgreen: "#90ee90",
        lightgrey: "#d3d3d3",
        lightpink: "#ffb6c1",
        lightsalmon: "#ffa07a",
        lightseagreen: "#20b2aa",
        lightskyblue: "#87cefa",
        lightslategray: "#778899",
        lightslategrey: "#778899",
        lightsteelblue: "#b0c4de",
        lightyellow: "#ffffe0",
        lime: "#00ff00",
        limegreen: "#32cd32",
        linen: "#faf0e6",
        magenta: "#ff00ff",
        maroon: "#800000",
        mediumaquamarine: "#66cdaa",
        mediumblue: "#0000cd",
        mediumorchid: "#ba55d3",
        mediumpurple: "#9370db",
        mediumseagreen: "#3cb371",
        mediumslateblue: "#7b68ee",
        mediumspringgreen: "#00fa9a",
        mediumturquoise: "#48d1cc",
        mediumvioletred: "#c71585",
        midnightblue: "#191970",
        mintcream: "#f5fffa",
        mistyrose: "#ffe4e1",
        moccasin: "#ffe4b5",
        navajowhite: "#ffdead",
        navy: "#000080",
        oldlace: "#fdf5e6",
        olive: "#808000",
        olivedrab: "#6b8e23",
        orange: "#ffa500",
        orangered: "#ff4500",
        orchid: "#da70d6",
        palegoldenrod: "#eee8aa",
        palegreen: "#98fb98",
        paleturquoise: "#afeeee",
        palevioletred: "#db7093",
        papayawhip: "#ffefd5",
        peachpuff: "#ffdab9",
        peru: "#cd853f",
        pink: "#ffc0cb",
        plum: "#dda0dd",
        powderblue: "#b0e0e6",
        purple: "#800080",
        red: "#ff0000",
        rosybrown: "#bc8f8f",
        royalblue: "#4169e1",
        saddlebrown: "#8b4513",
        salmon: "#fa8072",
        sandybrown: "#f4a460",
        seagreen: "#2e8b57",
        seashell: "#fff5ee",
        sienna: "#a0522d",
        silver: "#c0c0c0",
        skyblue: "#87ceeb",
        slateblue: "#6a5acd",
        slategray: "#708090",
        slategrey: "#708090",
        snow: "#fffafa",
        springgreen: "#00ff7f",
        steelblue: "#4682b4",
        tan: "#d2b48c",
        teal: "#008080",
        thistle: "#d8bfd8",
        tomato: "#ff6347",
        turquoise: "#40e0d0",
        violet: "#ee82ee",
        wheat: "#f5deb3",
        white: "#ffffff",
        whitesmoke: "#f5f5f5",
        yellow: "#ffff00",
        yellowgreen: "#9acd32"
    });
    ds.forEach(function (e, t) {
        ds.set(e, X(t, U, Y))
    }), d3.hsl = function (e, t, n) {
        return arguments.length === 1 ? e instanceof G ? Q(e.h, e.s, e.l) : X("" + e, V, Q) : Q(+e, +t, +n)
    };
    var vs = G.prototype = new R;
    vs.brighter = function (e) {
        return e = Math.pow(.7, arguments.length ? e : 1), Q(this.h, this.s, this.l / e)
    }, vs.darker = function (e) {
        return e = Math.pow(.7, arguments.length ? e : 1), Q(this.h, this.s, e * this.l)
    }, vs.rgb = function () {
        return Y(this.h, this.s, this.l)
    }, d3.hcl = function (e, t, n) {
        return arguments.length === 1 ? e instanceof et ? Z(e.h, e.c, e.l) : e instanceof rt ? st(e.l, e.a, e.b) : st((e = $((e = d3.rgb(e)).r, e.g, e.b)).l, e.a, e.b) : Z(+e, +t, +n)
    };
    var ms = et.prototype = new R;
    ms.brighter = function (e) {
        return Z(this.h, this.c, Math.min(100, this.l + gs * (arguments.length ? e : 1)))
    }, ms.darker = function (e) {
        return Z(this.h, this.c, Math.max(0, this.l - gs * (arguments.length ? e : 1)))
    }, ms.rgb = function () {
        return tt(this.h, this.c, this.l).rgb()
    }, d3.lab = function (e, t, n) {
        return arguments.length === 1 ? e instanceof rt ? nt(e.l, e.a, e.b) : e instanceof et ? tt(e.l, e.c, e.h) : $((e = d3.rgb(e)).r, e.g, e.b) : nt(+e, +t, +n)
    };
    var gs = 18,
        ys = .95047,
        bs = 1,
        ws = 1.08883,
        Es = rt.prototype = new R;
    Es.brighter = function (e) {
        return nt(Math.min(100, this.l + gs * (arguments.length ? e : 1)), this.a, this.b)
    }, Es.darker = function (e) {
        return nt(Math.max(0, this.l - gs * (arguments.length ? e : 1)), this.a, this.b)
    }, Es.rgb = function () {
        return it(this.l, this.a, this.b)
    };
    var Ss = function (e, t) {
        return t.querySelector(e)
    }, xs = function (e, t) {
            return t.querySelectorAll(e)
        }, Ts = document.documentElement,
        Ns = Ts.matchesSelector || Ts.webkitMatchesSelector || Ts.mozMatchesSelector || Ts.msMatchesSelector || Ts.oMatchesSelector,
        Cs = function (e, t) {
            return Ns.call(e, t)
        };
    typeof Sizzle == "function" && (Ss = function (e, t) {
        return Sizzle(e, t)[0] || null
    }, xs = function (e, t) {
        return Sizzle.uniqueSort(Sizzle(e, t))
    }, Cs = Sizzle.matchesSelector);
    var ks = [];
    d3.selection = function () {
        return Ls
    }, d3.selection.prototype = ks, ks.select = function (e) {
        var t = [],
            n, r, i, s;
        typeof e != "function" && (e = lt(e));
        for (var o = -1, u = this.length; ++o < u;) {
            t.push(n = []), n.parentNode = (i = this[o]).parentNode;
            for (var a = -1, f = i.length; ++a < f;)(s = i[a]) ? (n.push(r = e.call(s, s.__data__, a)), r && "__data__" in s && (r.__data__ = s.__data__)) : n.push(null)
        }
        return ft(t)
    }, ks.selectAll = function (e) {
        var t = [],
            n, r;
        typeof e != "function" && (e = ct(e));
        for (var i = -1, s = this.length; ++i < s;)
            for (var o = this[i], u = -1, a = o.length; ++u < a;)
                if (r = o[u]) t.push(n = Ji(e.call(r, r.__data__, u))), n.parentNode = r;
        return ft(t)
    }, ks.attr = function (e, t) {
        if (arguments.length < 2) {
            if (typeof e == "string") {
                var n = this.node();
                return e = d3.ns.qualify(e), e.local ? n.getAttributeNS(e.space, e.local) : n.getAttribute(e)
            }
            for (t in e) this.each(ht(t, e[t]));
            return this
        }
        return this.each(ht(e, t))
    }, ks.classed = function (e, t) {
        if (arguments.length < 2) {
            if (typeof e == "string") {
                var n = this.node(),
                    r = (e = e.trim().split(/^|\s+/g)).length,
                    i = -1;
                if (t = n.classList) {
                    while (++i < r)
                        if (!t.contains(e[i])) return !1
                } else {
                    t = n.className, t.baseVal != null && (t = t.baseVal);
                    while (++i < r)
                        if (!pt(e[i]).test(t)) return !1
                }
                return !0
            }
            for (t in e) this.each(dt(t, e[t]));
            return this
        }
        return this.each(dt(e, t))
    }, ks.style = function (e, t, n) {
        var r = arguments.length;
        if (r < 3) {
            if (typeof e != "string") {
                r < 2 && (t = "");
                for (n in e) this.each(mt(n, e[n], t));
                return this
            }
            if (r < 2) return window.getComputedStyle(this.node(), null).getPropertyValue(e);
            n = ""
        }
        return this.each(mt(e, t, n))
    }, ks.property = function (e, t) {
        if (arguments.length < 2) {
            if (typeof e == "string") return this.node()[e];
            for (t in e) this.each(gt(t, e[t]));
            return this
        }
        return this.each(gt(e, t))
    }, ks.text = function (e) {
        return arguments.length < 1 ? this.node().textContent : this.each(typeof e == "function" ? function () {
            var t = e.apply(this, arguments);
            this.textContent = t == null ? "" : t
        } : e == null ? function () {
            this.textContent = ""
        } : function () {
            this.textContent = e
        })
    }, ks.html = function (e) {
        return arguments.length < 1 ? this.node().innerHTML : this.each(typeof e == "function" ? function () {
            var t = e.apply(this, arguments);
            this.innerHTML = t == null ? "" : t
        } : e == null ? function () {
            this.innerHTML = ""
        } : function () {
            this.innerHTML = e
        })
    }, ks.append = function (e) {
        function t() {
            return this.appendChild(document.createElementNS(this.namespaceURI, e))
        }

        function n() {
            return this.appendChild(document.createElementNS(e.space, e.local))
        }
        return e = d3.ns.qualify(e), this.select(e.local ? n : t)
    }, ks.insert = function (e, t) {
        function n() {
            return this.insertBefore(document.createElementNS(this.namespaceURI, e), Ss(t, this))
        }

        function r() {
            return this.insertBefore(document.createElementNS(e.space, e.local), Ss(t, this))
        }
        return e = d3.ns.qualify(e), this.select(e.local ? r : n)
    }, ks.remove = function () {
        return this.each(function () {
            var e = this.parentNode;
            e && e.removeChild(this)
        })
    }, ks.data = function (e, t) {
        function n(e, n) {
            var i, s = e.length,
                o = n.length,
                u = Math.min(s, o),
                c = Math.max(s, o),
                h = [],
                p = [],
                d = [],
                v, m;
            if (t) {
                var g = new r,
                    y = [],
                    b, w = n.length;
                for (i = -1; ++i < s;) b = t.call(v = e[i], v.__data__, i), g.has(b) ? d[w++] = v : g.set(b, v), y.push(b);
                for (i = -1; ++i < o;) b = t.call(n, m = n[i], i), g.has(b) ? (h[i] = v = g.get(b), v.__data__ = m, p[i] = d[i] = null) : (p[i] = yt(m), h[i] = d[i] = null), g.remove(b);
                for (i = -1; ++i < s;) g.has(y[i]) && (d[i] = e[i])
            } else {
                for (i = -1; ++i < u;) v = e[i], m = n[i], v ? (v.__data__ = m, h[i] = v, p[i] = d[i] = null) : (p[i] = yt(m), h[i] = d[i] = null);
                for (; i < o; ++i) p[i] = yt(n[i]), h[i] = d[i] = null;
                for (; i < c; ++i) d[i] = e[i], p[i] = h[i] = null
            }
            p.update = h, p.parentNode = h.parentNode = d.parentNode = e.parentNode, a.push(p), f.push(h), l.push(d)
        }
        var i = -1,
            s = this.length,
            o, u;
        if (!arguments.length) {
            e = new Array(s = (o = this[0]).length);
            while (++i < s)
                if (u = o[i]) e[i] = u.__data__;
            return e
        }
        var a = xt([]),
            f = ft([]),
            l = ft([]);
        if (typeof e == "function")
            while (++i < s) n(o = this[i], e.call(o, o.parentNode.__data__, i));
        else
            while (++i < s) n(o = this[i], e);
        return f.enter = function () {
            return a
        }, f.exit = function () {
            return l
        }, f
    }, ks.datum = ks.map = function (e) {
        return arguments.length < 1 ? this.property("__data__") : this.property("__data__", e)
    }, ks.filter = function (e) {
        var t = [],
            n, r, i;
        typeof e != "function" && (e = bt(e));
        for (var s = 0, o = this.length; s < o; s++) {
            t.push(n = []), n.parentNode = (r = this[s]).parentNode;
            for (var u = 0, a = r.length; u < a; u++)(i = r[u]) && e.call(i, i.__data__, u) && n.push(i)
        }
        return ft(t)
    }, ks.order = function () {
        for (var e = -1, t = this.length; ++e < t;)
            for (var n = this[e], r = n.length - 1, i = n[r], s; --r >= 0;)
                if (s = n[r]) i && i !== s.nextSibling && i.parentNode.insertBefore(s, i), i = s;
        return this
    }, ks.sort = function (e) {
        e = wt.apply(this, arguments);
        for (var t = -1, n = this.length; ++t < n;) this[t].sort(e);
        return this.order()
    }, ks.on = function (e, t, n) {
        var r = arguments.length;
        if (r < 3) {
            if (typeof e != "string") {
                r < 2 && (t = !1);
                for (n in e) this.each(Et(n, e[n], t));
                return this
            }
            if (r < 2) return (r = this.node()["__on" + e]) && r._;
            n = !1
        }
        return this.each(Et(e, t, n))
    }, ks.each = function (e) {
        return St(this, function (t, n, r) {
            e.call(t, t.__data__, n, r)
        })
    }, ks.call = function (e) {
        return e.apply(this, (arguments[0] = this, arguments)), this
    }, ks.empty = function () {
        return !this.node()
    }, ks.node = function (e) {
        for (var t = 0, n = this.length; t < n; t++)
            for (var r = this[t], i = 0, s = r.length; i < s; i++) {
                var o = r[i];
                if (o) return o
            }
        return null
    }, ks.transition = function () {
        var e = [],
            t, n;
        for (var r = -1, i = this.length; ++r < i;) {
            e.push(t = []);
            for (var s = this[r], o = -1, u = s.length; ++o < u;) t.push((n = s[o]) ? {
                node: n,
                delay: Bs,
                duration: js
            } : null)
        }
        return Tt(e, _s || ++Ms, Date.now())
    };
    var Ls = ft([
        [document]
    ]);
    Ls[0].parentNode = Ts, d3.select = function (e) {
        return typeof e == "string" ? Ls.select(e) : ft([
            [e]
        ])
    }, d3.selectAll = function (e) {
        return typeof e == "string" ? Ls.selectAll(e) : ft([Ji(e)])
    };
    var As = [];
    d3.selection.enter = xt, d3.selection.enter.prototype = As, As.append = ks.append, As.insert = ks.insert, As.empty = ks.empty, As.node = ks.node, As.select = function (e) {
        var t = [],
            n, r, i, s, o;
        for (var u = -1, a = this.length; ++u < a;) {
            i = (s = this[u]).update, t.push(n = []), n.parentNode = s.parentNode;
            for (var f = -1, l = s.length; ++f < l;)(o = s[f]) ? (n.push(i[f] = r = e.call(s.parentNode, o.__data__, f)), r.__data__ = o.__data__) : n.push(null)
        }
        return ft(t)
    };
    var Os = [],
        Ms = 0,
        _s = 0,
        Ds = 0,
        Ps = 250,
        Hs = d3.ease("cubic-in-out"),
        Bs = Ds,
        js = Ps,
        Fs = Hs;
    Os.call = ks.call, d3.transition = function (e) {
        return arguments.length ? _s ? e.transition() : e : Ls.transition()
    }, d3.transition.prototype = Os, Os.select = function (e) {
        var t = [],
            n, r, i;
        typeof e != "function" && (e = lt(e));
        for (var s = -1, o = this.length; ++s < o;) {
            t.push(n = []);
            for (var u = this[s], a = -1, f = u.length; ++a < f;)(i = u[a]) && (r = e.call(i.node, i.node.__data__, a)) ? ("__data__" in i.node && (r.__data__ = i.node.__data__), n.push({
                node: r,
                delay: i.delay,
                duration: i.duration
            })) : n.push(null)
        }
        return Tt(t, this.id, this.time).ease(this.ease())
    }, Os.selectAll = function (e) {
        var t = [],
            n, r, i;
        typeof e != "function" && (e = ct(e));
        for (var s = -1, o = this.length; ++s < o;)
            for (var u = this[s], a = -1, f = u.length; ++a < f;)
                if (i = u[a]) {
                    r = e.call(i.node, i.node.__data__, a), t.push(n = []);
                    for (var l = -1, c = r.length; ++l < c;) n.push({
                        node: r[l],
                        delay: i.delay,
                        duration: i.duration
                    })
                }
        return Tt(t, this.id, this.time).ease(this.ease())
    }, Os.filter = function (e) {
        var t = [],
            n, r, i;
        typeof e != "function" && (e = bt(e));
        for (var s = 0, o = this.length; s < o; s++) {
            t.push(n = []);
            for (var r = this[s], u = 0, a = r.length; u < a; u++)(i = r[u]) && e.call(i.node, i.node.__data__, u) && n.push(i)
        }
        return Tt(t, this.id, this.time).ease(this.ease())
    }, Os.attr = function (e, t) {
        if (arguments.length < 2) {
            for (t in e) this.attrTween(t, kt(e[t], t));
            return this
        }
        return this.attrTween(e, kt(t, e))
    }, Os.attrTween = function (e, t) {
        function n(e, n) {
            var r = t.call(this, e, n, this.getAttribute(i));
            return r === Is ? (this.removeAttribute(i), null) : r && function (e) {
                this.setAttribute(i, r(e))
            }
        }

        function r(e, n) {
            var r = t.call(this, e, n, this.getAttributeNS(i.space, i.local));
            return r === Is ? (this.removeAttributeNS(i.space, i.local), null) : r && function (e) {
                this.setAttributeNS(i.space, i.local, r(e))
            }
        }
        var i = d3.ns.qualify(e);
        return this.tween("attr." + e, i.local ? r : n)
    }, Os.style = function (e, t, n) {
        var r = arguments.length;
        if (r < 3) {
            if (typeof e != "string") {
                r < 2 && (t = "");
                for (n in e) this.styleTween(n, kt(e[n], n), t);
                return this
            }
            n = ""
        }
        return this.styleTween(e, kt(t, e), n)
    }, Os.styleTween = function (e, t, n) {
        return arguments.length < 3 && (n = ""), this.tween("style." + e, function (r, i) {
            var s = t.call(this, r, i, window.getComputedStyle(this, null).getPropertyValue(e));
            return s === Is ? (this.style.removeProperty(e), null) : s && function (t) {
                this.style.setProperty(e, s(t), n)
            }
        })
    }, Os.text = function (e) {
        return this.tween("text", function (t, n) {
            this.textContent = typeof e == "function" ? e.call(this, t, n) : e
        })
    }, Os.remove = function () {
        return this.each("end.transition", function () {
            var e;
            !this.__transition__ && (e = this.parentNode) && e.removeChild(this)
        })
    }, Os.delay = function (e) {
        return St(this, typeof e == "function" ? function (t, n, r) {
            t.delay = e.call(t = t.node, t.__data__, n, r) | 0
        } : (e |= 0, function (t) {
            t.delay = e
        }))
    }, Os.duration = function (e) {
        return St(this, typeof e == "function" ? function (t, n, r) {
            t.duration = Math.max(1, e.call(t = t.node, t.__data__, n, r) | 0)
        } : (e = Math.max(1, e | 0), function (t) {
            t.duration = e
        }))
    }, Os.transition = function () {
        return this.select(s)
    }, d3.tween = function (e, t) {
        function n(n, r, i) {
            var s = e.call(this, n, r);
            return s == null ? i != "" && Is : i != s && t(i, s + "")
        }

        function r(n, r, i) {
            return i != e && t(i, e)
        }
        return typeof e == "function" ? n : e == null ? Ct : (e += "", r)
    };
    var Is = {}, qs = 0,
        Rs = {}, Us = null,
        zs, Ws;
    d3.timer = function (e, t, n) {
        if (arguments.length < 3) {
            if (arguments.length < 2) t = 0;
            else if (!isFinite(t)) return;
            n = Date.now()
        }
        var r = Rs[e.id];
        r && r.callback === e ? (r.then = n, r.delay = t) : Rs[e.id = ++qs] = Us = {
            callback: e,
            then: n,
            delay: t,
            next: Us
        }, zs || (Ws = clearTimeout(Ws), zs = 1, Xs(Lt))
    }, d3.timer.flush = function () {
        var e, t = Date.now(),
            n = Us;
        while (n) e = t - n.then, n.delay || (n.flush = n.callback(e)), n = n.next;
        At()
    };
    var Xs = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function (e) {
            setTimeout(e, 17)
        };
    d3.mouse = function (e) {
        return Ot(e, _())
    };
    var Vs = /WebKit/.test(navigator.userAgent) ? -1 : 0;
    d3.touches = function (e, t) {
        return arguments.length < 2 && (t = _().touches), t ? Ji(t).map(function (t) {
            var n = Ot(e, t);
            return n.identifier = t.identifier, n
        }) : []
    }, d3.scale = {}, d3.scale.linear = function () {
        return Bt([0, 1], [0, 1], d3.interpolate, !1)
    }, d3.scale.log = function () {
        return Wt(d3.scale.linear(), Xt)
    };
    var $s = d3.format(".0e");
    Xt.pow = function (e) {
        return Math.pow(10, e)
    }, Vt.pow = function (e) {
        return -Math.pow(10, -e)
    }, d3.scale.pow = function () {
        return $t(d3.scale.linear(), 1)
    }, d3.scale.sqrt = function () {
        return d3.scale.pow().exponent(.5)
    }, d3.scale.ordinal = function () {
        return Kt([], {
            t: "range",
            a: [
                []
            ]
        })
    }, d3.scale.category10 = function () {
        return d3.scale.ordinal().range(Js)
    }, d3.scale.category20 = function () {
        return d3.scale.ordinal().range(Ks)
    }, d3.scale.category20b = function () {
        return d3.scale.ordinal().range(Qs)
    }, d3.scale.category20c = function () {
        return d3.scale.ordinal().range(Gs)
    };
    var Js = ["#1f77b4", "#ff7f0e", "#2ca02c", "#d62728", "#9467bd", "#8c564b", "#e377c2", "#7f7f7f", "#bcbd22", "#17becf"],
        Ks = ["#1f77b4", "#aec7e8", "#ff7f0e", "#ffbb78", "#2ca02c", "#98df8a", "#d62728", "#ff9896", "#9467bd", "#c5b0d5", "#8c564b", "#c49c94", "#e377c2", "#f7b6d2", "#7f7f7f", "#c7c7c7", "#bcbd22", "#dbdb8d", "#17becf", "#9edae5"],
        Qs = ["#393b79", "#5254a3", "#6b6ecf", "#9c9ede", "#637939", "#8ca252", "#b5cf6b", "#cedb9c", "#8c6d31", "#bd9e39", "#e7ba52", "#e7cb94", "#843c39", "#ad494a", "#d6616b", "#e7969c", "#7b4173", "#a55194", "#ce6dbd", "#de9ed6"],
        Gs = ["#3182bd", "#6baed6", "#9ecae1", "#c6dbef", "#e6550d", "#fd8d3c", "#fdae6b", "#fdd0a2", "#31a354", "#74c476", "#a1d99b", "#c7e9c0", "#756bb1", "#9e9ac8", "#bcbddc", "#dadaeb", "#636363", "#969696", "#bdbdbd", "#d9d9d9"];
    d3.scale.quantile = function () {
        return Qt([], [])
    }, d3.scale.quantize = function () {
        return Gt(0, 1, [0, 1])
    }, d3.scale.threshold = function () {
        return Yt([.5], [0, 1])
    }, d3.scale.identity = function () {
        return Zt([0, 1])
    }, d3.svg = {}, d3.svg.arc = function () {
        function e() {
            var e = t.apply(this, arguments),
                s = n.apply(this, arguments),
                o = r.apply(this, arguments) + Ys,
                u = i.apply(this, arguments) + Ys,
                a = (u < o && (a = o, o = u, u = a), u - o),
                f = a < Math.PI ? "0" : "1",
                l = Math.cos(o),
                c = Math.sin(o),
                h = Math.cos(u),
                p = Math.sin(u);
            return a >= Zs ? e ? "M0," + s + "A" + s + "," + s + " 0 1,1 0," + -s + "A" + s + "," + s + " 0 1,1 0," + s + "M0," + e + "A" + e + "," + e + " 0 1,0 0," + -e + "A" + e + "," + e + " 0 1,0 0," + e + "Z" : "M0," + s + "A" + s + "," + s + " 0 1,1 0," + -s + "A" + s + "," + s + " 0 1,1 0," + s + "Z" : e ? "M" + s * l + "," + s * c + "A" + s + "," + s + " 0 " + f + ",1 " + s * h + "," + s * p + "L" + e * h + "," + e * p + "A" + e + "," + e + " 0 " + f + ",0 " + e * l + "," + e * c + "Z" : "M" + s * l + "," + s * c + "A" + s + "," + s + " 0 " + f + ",1 " + s * h + "," + s * p + "L0,0" + "Z"
        }
        var t = en,
            n = tn,
            r = nn,
            i = rn;
        return e.innerRadius = function (n) {
            return arguments.length ? (t = u(n), e) : t
        }, e.outerRadius = function (t) {
            return arguments.length ? (n = u(t), e) : n
        }, e.startAngle = function (t) {
            return arguments.length ? (r = u(t), e) : r
        }, e.endAngle = function (t) {
            return arguments.length ? (i = u(t), e) : i
        }, e.centroid = function () {
            var e = (t.apply(this, arguments) + n.apply(this, arguments)) / 2,
                s = (r.apply(this, arguments) + i.apply(this, arguments)) / 2 + Ys;
            return [Math.cos(s) * e, Math.sin(s) * e]
        }, e
    };
    var Ys = -Math.PI / 2,
        Zs = 2 * Math.PI - 1e-6;
    d3.svg.line = function () {
        return sn(i)
    };
    var eo = d3.map({
        linear: an,
        "linear-closed": fn,
        "step-before": ln,
        "step-after": cn,
        basis: gn,
        "basis-open": yn,
        "basis-closed": bn,
        bundle: wn,
        cardinal: dn,
        "cardinal-open": hn,
        "cardinal-closed": pn,
        monotone: Cn
    });
    eo.forEach(function (e, t) {
        t.key = e, t.closed = /-closed$/.test(e)
    });
    var to = [0, 2 / 3, 1 / 3, 0],
        no = [0, 1 / 3, 2 / 3, 0],
        ro = [0, 1 / 6, 2 / 3, 1 / 6];
    d3.svg.line.radial = function () {
        var e = sn(kn);
        return e.radius = e.x, delete e.x, e.angle = e.y, delete e.y, e
    }, ln.reverse = cn, cn.reverse = ln, d3.svg.area = function () {
        return Ln(i)
    }, d3.svg.area.radial = function () {
        var e = Ln(kn);
        return e.radius = e.x, delete e.x, e.innerRadius = e.x0, delete e.x0, e.outerRadius = e.x1, delete e.x1, e.angle = e.y, delete e.y, e.startAngle = e.y0, delete e.y0, e.endAngle = e.y1, delete e.y1, e
    }, d3.svg.chord = function () {
        function e(e, u) {
            var a = t(this, s, e, u),
                f = t(this, o, e, u);
            return "M" + a.p0 + r(a.r, a.p1, a.a1 - a.a0) + (n(a, f) ? i(a.r, a.p1, a.r, a.p0) : i(a.r, a.p1, f.r, f.p0) + r(f.r, f.p1, f.a1 - f.a0) + i(f.r, f.p1, a.r, a.p0)) + "Z"
        }

        function t(e, t, n, r) {
            var i = t.call(e, n, r),
                s = a.call(e, i, r),
                o = f.call(e, i, r) + Ys,
                u = l.call(e, i, r) + Ys;
            return {
                r: s,
                a0: o,
                a1: u,
                p0: [s * Math.cos(o), s * Math.sin(o)],
                p1: [s * Math.cos(u), s * Math.sin(u)]
            }
        }

        function n(e, t) {
            return e.a0 == t.a0 && e.a1 == t.a1
        }

        function r(e, t, n) {
            return "A" + e + "," + e + " 0 " + +(n > Math.PI) + ",1 " + t
        }

        function i(e, t, n, r) {
            return "Q 0,0 " + r
        }
        var s = An,
            o = On,
            a = Mn,
            f = nn,
            l = rn;
        return e.radius = function (t) {
            return arguments.length ? (a = u(t), e) : a
        }, e.source = function (t) {
            return arguments.length ? (s = u(t), e) : s
        }, e.target = function (t) {
            return arguments.length ? (o = u(t), e) : o
        }, e.startAngle = function (t) {
            return arguments.length ? (f = u(t), e) : f
        }, e.endAngle = function (t) {
            return arguments.length ? (l = u(t), e) : l
        }, e
    }, d3.svg.diagonal = function () {
        function e(e, i) {
            var s = t.call(this, e, i),
                o = n.call(this, e, i),
                u = (s.y + o.y) / 2,
                a = [s, {
                        x: s.x,
                        y: u
                    }, {
                        x: o.x,
                        y: u
                    },
                    o
                ];
            return a = a.map(r), "M" + a[0] + "C" + a[1] + " " + a[2] + " " + a[3]
        }
        var t = An,
            n = On,
            r = Pn;
        return e.source = function (n) {
            return arguments.length ? (t = u(n), e) : t
        }, e.target = function (t) {
            return arguments.length ? (n = u(t), e) : n
        }, e.projection = function (t) {
            return arguments.length ? (r = t, e) : r
        }, e
    }, d3.svg.diagonal.radial = function () {
        var e = d3.svg.diagonal(),
            t = Pn,
            n = e.projection;
        return e.projection = function (e) {
            return arguments.length ? n(Hn(t = e)) : t
        }, e
    }, d3.svg.mouse = d3.mouse, d3.svg.touches = d3.touches, d3.svg.symbol = function () {
        function e(e, r) {
            return (io.get(t.call(this, e, r)) || Fn)(n.call(this, e, r))
        }
        var t = jn,
            n = Bn;
        return e.type = function (n) {
            return arguments.length ? (t = u(n), e) : t
        }, e.size = function (t) {
            return arguments.length ? (n = u(t), e) : n
        }, e
    };
    var io = d3.map({
        circle: Fn,
        cross: function (e) {
            var t = Math.sqrt(e / 5) / 2;
            return "M" + -3 * t + "," + -t + "H" + -t + "V" + -3 * t + "H" + t + "V" + -t + "H" + 3 * t + "V" + t + "H" + t + "V" + 3 * t + "H" + -t + "V" + t + "H" + -3 * t + "Z"
        },
        diamond: function (e) {
            var t = Math.sqrt(e / (2 * oo)),
                n = t * oo;
            return "M0," + -t + "L" + n + ",0" + " 0," + t + " " + -n + ",0" + "Z"
        },
        square: function (e) {
            var t = Math.sqrt(e) / 2;
            return "M" + -t + "," + -t + "L" + t + "," + -t + " " + t + "," + t + " " + -t + "," + t + "Z"
        },
        "triangle-down": function (e) {
            var t = Math.sqrt(e / so),
                n = t * so / 2;
            return "M0," + n + "L" + t + "," + -n + " " + -t + "," + -n + "Z"
        },
        "triangle-up": function (e) {
            var t = Math.sqrt(e / so),
                n = t * so / 2;
            return "M0," + -n + "L" + t + "," + n + " " + -t + "," + n + "Z"
        }
    });
    d3.svg.symbolTypes = io.keys();
    var so = Math.sqrt(3),
        oo = Math.tan(30 * Math.PI / 180);
    d3.svg.axis = function () {
        function e(e) {
            e.each(function () {
                var e = d3.select(this),
                    c = a == null ? t.ticks ? t.ticks.apply(t, u) : t.domain() : a,
                    h = f == null ? t.tickFormat ? t.tickFormat.apply(t, u) : String : f,
                    p = Rn(t, c, l),
                    d = e.selectAll(".minor").data(p, String),
                    v = d.enter().insert("line", "g").attr("class", "tick minor").style("opacity", 1e-6),
                    m = d3.transition(d.exit()).style("opacity", 1e-6).remove(),
                    g = d3.transition(d).style("opacity", 1),
                    y = e.selectAll("g").data(c, String),
                    b = y.enter().insert("g", "path").style("opacity", 1e-6),
                    w = d3.transition(y.exit()).style("opacity", 1e-6).remove(),
                    E = d3.transition(y).style("opacity", 1),
                    S, x = Dt(t),
                    T = e.selectAll(".domain").data([0]),
                    N = T.enter().append("path").attr("class", "domain"),
                    C = d3.transition(T),
                    k = t.copy(),
                    L = this.__chart__ || k;
                this.__chart__ = k, b.append("line").attr("class", "tick"), b.append("text");
                var A = b.select("line"),
                    O = E.select("line"),
                    M = y.select("text").text(h),
                    _ = b.select("text"),
                    D = E.select("text");
                switch (n) {
                case "bottom":
                    S = In, v.attr("y2", i), g.attr("x2", 0).attr("y2", i), A.attr("y2", r), _.attr("y", Math.max(r, 0) + o), O.attr("x2", 0).attr("y2", r), D.attr("x", 0).attr("y", Math.max(r, 0) + o), M.attr("dy", ".71em").attr("text-anchor", "middle"), C.attr("d", "M" + x[0] + "," + s + "V0H" + x[1] + "V" + s);
                    break;
                case "top":
                    S = In, v.attr("y2", -i), g.attr("x2", 0).attr("y2", -i), A.attr("y2", -r), _.attr("y", -(Math.max(r, 0) + o)), O.attr("x2", 0).attr("y2", -r), D.attr("x", 0).attr("y", -(Math.max(r, 0) + o)), M.attr("dy", "0em").attr("text-anchor", "middle"), C.attr("d", "M" + x[0] + "," + -s + "V0H" + x[1] + "V" + -s);
                    break;
                case "left":
                    S = qn, v.attr("x2", -i), g.attr("x2", -i).attr("y2", 0), A.attr("x2", -r), _.attr("x", -(Math.max(r, 0) + o)), O.attr("x2", -r).attr("y2", 0), D.attr("x", -(Math.max(r, 0) + o)).attr("y", 0), M.attr("dy", ".32em").attr("text-anchor", "end"), C.attr("d", "M" + -s + "," + x[0] + "H0V" + x[1] + "H" + -s);
                    break;
                case "right":
                    S = qn, v.attr("x2", i), g.attr("x2", i).attr("y2", 0), A.attr("x2", r), _.attr("x", Math.max(r, 0) + o), O.attr("x2", r).attr("y2", 0), D.attr("x", Math.max(r, 0) + o).attr("y", 0), M.attr("dy", ".32em").attr("text-anchor", "start"), C.attr("d", "M" + s + "," + x[0] + "H0V" + x[1] + "H" + s)
                }
                if (t.ticks) b.call(S, L), E.call(S, k), w.call(S, k), v.call(S, L), g.call(S, k), m.call(S, k);
                else {
                    var P = k.rangeBand() / 2,
                        H = function (e) {
                            return k(e) + P
                        };
                    b.call(S, H), E.call(S, H)
                }
            })
        }
        var t = d3.scale.linear(),
            n = "bottom",
            r = 6,
            i = 6,
            s = 6,
            o = 3,
            u = [10],
            a = null,
            f, l = 0;
        return e.scale = function (n) {
            return arguments.length ? (t = n, e) : t
        }, e.orient = function (t) {
            return arguments.length ? (n = t, e) : n
        }, e.ticks = function () {
            return arguments.length ? (u = arguments, e) : u
        }, e.tickValues = function (t) {
            return arguments.length ? (a = t, e) : a
        }, e.tickFormat = function (t) {
            return arguments.length ? (f = t, e) : f
        }, e.tickSize = function (t, n, o) {
            if (!arguments.length) return r;
            var u = arguments.length - 1;
            return r = +t, i = u > 1 ? +n : r, s = u > 0 ? +arguments[u] : r, e
        }, e.tickPadding = function (t) {
            return arguments.length ? (o = +t, e) : o
        }, e.tickSubdivide = function (t) {
            return arguments.length ? (l = +t, e) : l
        }, e
    }, d3.svg.brush = function () {
        function e(s) {
            s.each(function () {
                var s = d3.select(this),
                    f = s.selectAll(".background").data([0]),
                    l = s.selectAll(".extent").data([0]),
                    c = s.selectAll(".resize").data(a, String),
                    h;
                s.style("pointer-events", "all").on("mousedown.brush", i).on("touchstart.brush", i), f.enter().append("rect").attr("class", "background").style("visibility", "hidden").style("cursor", "crosshair"), l.enter().append("rect").attr("class", "extent").style("cursor", "move"), c.enter().append("g").attr("class", function (e) {
                    return "resize " + e
                }).style("cursor", function (e) {
                    return uo[e]
                }).append("rect").attr("x", function (e) {
                    return /[ew]$/.test(e) ? -3 : null
                }).attr("y", function (e) {
                    return /^[ns]/.test(e) ? -3 : null
                }).attr("width", 6).attr("height", 6).style("visibility", "hidden"), c.style("display", e.empty() ? "none" : null), c.exit().remove(), o && (h = Dt(o), f.attr("x", h[0]).attr("width", h[1] - h[0]), n(s)), u && (h = Dt(u), f.attr("y", h[0]).attr("height", h[1] - h[0]), r(s)), t(s)
            })
        }

        function t(e) {
            e.selectAll(".resize").attr("transform", function (e) {
                return "translate(" + f[+/e$/.test(e)][0] + "," + f[+/^s/.test(e)][1] + ")"
            })
        }

        function n(e) {
            e.select(".extent").attr("x", f[0][0]), e.selectAll(".extent,.n>rect,.s>rect").attr("width", f[1][0] - f[0][0])
        }

        function r(e) {
            e.select(".extent").attr("y", f[0][1]), e.selectAll(".extent,.e>rect,.w>rect").attr("height", f[1][1] - f[0][1])
        }

        function i() {
            function i() {
                var e = d3.event.changedTouches;
                return e ? d3.touches(v, e)[0] : d3.mouse(v)
            }

            function a() {
                d3.event.keyCode == 32 && (S || (x = null, T[0] -= f[1][0], T[1] -= f[1][1], S = 2), M())
            }

            function c() {
                d3.event.keyCode == 32 && S == 2 && (T[0] += f[1][0], T[1] += f[1][1], S = 0, M())
            }

            function h() {
                var e = i(),
                    s = !1;
                N && (e[0] += N[0], e[1] += N[1]), S || (d3.event.altKey ? (x || (x = [(f[0][0] + f[1][0]) / 2, (f[0][1] + f[1][1]) / 2]), T[0] = f[+(e[0] < x[0])][0], T[1] = f[+(e[1] < x[1])][1]) : x = null), w && p(e, o, 0) && (n(y), s = !0), E && p(e, u, 1) && (r(y), s = !0), s && (t(y), g({
                    type: "brush",
                    mode: S ? "move" : "resize"
                }))
            }

            function p(e, t, n) {
                var r = Dt(t),
                    i = r[0],
                    s = r[1],
                    o = T[n],
                    u = f[1][n] - f[0][n],
                    a, c;
                S && (i -= o, s -= u + o), a = Math.max(i, Math.min(s, e[n])), S ? c = (a += o) + u : (x && (o = Math.max(i, Math.min(s, 2 * x[n] - a))), o < a ? (c = a, a = o) : c = o);
                if (f[0][n] !== a || f[1][n] !== c) return l = null, f[0][n] = a, f[1][n] = c, !0
            }

            function d() {
                h(), y.style("pointer-events", "all").selectAll(".resize").style("display", e.empty() ? "none" : null), d3.select("body").style("cursor", null), C.on("mousemove.brush", null).on("mouseup.brush", null).on("touchmove.brush", null).on("touchend.brush", null).on("keydown.brush", null).on("keyup.brush", null), g({
                    type: "brushend"
                }), M()
            }
            var v = this,
                m = d3.select(d3.event.target),
                g = s.of(v, arguments),
                y = d3.select(v),
                b = m.datum(),
                w = !/^(n|s)$/.test(b) && o,
                E = !/^(e|w)$/.test(b) && u,
                S = m.classed("extent"),
                x, T = i(),
                N, C = d3.select(window).on("mousemove.brush", h).on("mouseup.brush", d).on("touchmove.brush", h).on("touchend.brush", d).on("keydown.brush", a).on("keyup.brush", c);
            if (S) T[0] = f[0][0] - T[0], T[1] = f[0][1] - T[1];
            else if (b) {
                var k = +/w$/.test(b),
                    L = +/^n/.test(b);
                N = [f[1 - k][0] - T[0], f[1 - L][1] - T[1]], T[0] = f[k][0], T[1] = f[L][1]
            } else d3.event.altKey && (x = T.slice());
            y.style("pointer-events", "none").selectAll(".resize").style("display", null), d3.select("body").style("cursor", m.style("cursor")), g({
                type: "brushstart"
            }), h(), M()
        }
        var s = D(e, "brushstart", "brush", "brushend"),
            o = null,
            u = null,
            a = ao[0],
            f = [
                [0, 0],
                [0, 0]
            ],
            l;
        return e.x = function (t) {
            return arguments.length ? (o = t, a = ao[!o << 1 | !u], e) : o
        }, e.y = function (t) {
            return arguments.length ? (u = t, a = ao[!o << 1 | !u], e) : u
        }, e.extent = function (t) {
            var n, r, i, s, a;
            return arguments.length ? (l = [
                [0, 0],
                [0, 0]
            ], o && (n = t[0], r = t[1], u && (n = n[0], r = r[0]), l[0][0] = n, l[1][0] = r, o.invert && (n = o(n), r = o(r)), r < n && (a = n, n = r, r = a), f[0][0] = n | 0, f[1][0] = r | 0), u && (i = t[0], s = t[1], o && (i = i[1], s = s[1]), l[0][1] = i, l[1][1] = s, u.invert && (i = u(i), s = u(s)), s < i && (a = i, i = s, s = a), f[0][1] = i | 0, f[1][1] = s | 0), e) : (t = l || f, o && (n = t[0][0], r = t[1][0], l || (n = f[0][0], r = f[1][0], o.invert && (n = o.invert(n), r = o.invert(r)), r < n && (a = n, n = r, r = a))), u && (i = t[0][1], s = t[1][1], l || (i = f[0][1], s = f[1][1], u.invert && (i = u.invert(i), s = u.invert(s)), s < i && (a = i, i = s, s = a))), o && u ? [
                [n, i],
                [r, s]
            ] : o ? [n, r] : u && [i, s])
        }, e.clear = function () {
            return l = null, f[0][0] = f[0][1] = f[1][0] = f[1][1] = 0, e
        }, e.empty = function () {
            return o && f[0][0] === f[1][0] || u && f[0][1] === f[1][1]
        }, d3.rebind(e, s, "on")
    };
    var uo = {
        n: "ns-resize",
        e: "ew-resize",
        s: "ns-resize",
        w: "ew-resize",
        nw: "nwse-resize",
        ne: "nesw-resize",
        se: "nwse-resize",
        sw: "nesw-resize"
    }, ao = [
            ["n", "e", "s", "w", "nw", "ne", "se", "sw"],
            ["e", "w"],
            ["n", "s"],
            []
        ];
    d3.behavior = {}, d3.behavior.drag = function () {
        function e() {
            this.on("mousedown.drag", t).on("touchstart.drag", t)
        }

        function t() {
            function e() {
                var e = o.parentNode;
                return f ? d3.touches(e).filter(function (e) {
                    return e.identifier === f
                })[0] : d3.mouse(e)
            }

            function t() {
                if (!o.parentNode) return i();
                var t = e(),
                    n = t[0] - c[0],
                    r = t[1] - c[1];
                h |= n | r, c = t, M(), u({
                    type: "drag",
                    x: t[0] + l[0],
                    y: t[1] + l[1],
                    dx: n,
                    dy: r
                })
            }

            function i() {
                u({
                    type: "dragend"
                }), h && (M(), d3.event.target === a && p.on("click.drag", s, !0)), p.on(f ? "touchmove.drag-" + f : "mousemove.drag", null).on(f ? "touchend.drag-" + f : "mouseup.drag", null)
            }

            function s() {
                M(), p.on("click.drag", null)
            }
            var o = this,
                u = n.of(o, arguments),
                a = d3.event.target,
                f = d3.event.touches && d3.event.changedTouches[0].identifier,
                l, c = e(),
                h = 0,
                p = d3.select(window).on(f ? "touchmove.drag-" + f : "mousemove.drag", t).on(f ? "touchend.drag-" + f : "mouseup.drag", i, !0);
            r ? (l = r.apply(o, arguments), l = [l.x - c[0], l.y - c[1]]) : l = [0, 0], f || M(), u({
                type: "dragstart"
            })
        }
        var n = D(e, "drag", "dragstart", "dragend"),
            r = null;
        return e.origin = function (t) {
            return arguments.length ? (r = t, e) : r
        }, d3.rebind(e, n, "on")
    }, d3.behavior.zoom = function () {
        function e() {
            this.on("mousedown.zoom", o).on("mousewheel.zoom", u).on("mousemove.zoom", a).on("DOMMouseScroll.zoom", u).on("dblclick.zoom", f).on("touchstart.zoom", l).on("touchmove.zoom", c).on("touchend.zoom", l)
        }

        function t(e) {
            return [(e[0] - h[0]) / d, (e[1] - h[1]) / d]
        }

        function n(e) {
            return [e[0] * d + h[0], e[1] * d + h[1]]
        }

        function r(e) {
            d = Math.max(m[0], Math.min(m[1], e))
        }

        function i(e, t) {
            t = n(t), h[0] += e[0] - t[0], h[1] += e[1] - t[1]
        }

        function s(e) {
            b && b.domain(y.range().map(function (e) {
                return (e - h[0]) / d
            }).map(y.invert)), E && E.domain(w.range().map(function (e) {
                return (e - h[1]) / d
            }).map(w.invert)), d3.event.preventDefault(), e({
                type: "zoom",
                scale: d,
                translate: h
            })
        }

        function o() {
            function e() {
                f = 1, i(d3.mouse(o), c), s(u)
            }

            function n() {
                f && M(), l.on("mousemove.zoom", null).on("mouseup.zoom", null), f && d3.event.target === a && l.on("click.zoom", r, !0)
            }

            function r() {
                M(), l.on("click.zoom", null)
            }
            var o = this,
                u = g.of(o, arguments),
                a = d3.event.target,
                f = 0,
                l = d3.select(window).on("mousemove.zoom", e).on("mouseup.zoom", n),
                c = t(d3.mouse(o));
            window.focus(), M()
        }

        function u() {
            p || (p = t(d3.mouse(this))), r(Math.pow(2, Un() * .002) * d), i(d3.mouse(this), p), s(g.of(this, arguments))
        }

        function a() {
            p = null
        }

        function f() {
            var e = d3.mouse(this),
                n = t(e);
            r(d3.event.shiftKey ? d / 2 : d * 2), i(e, n), s(g.of(this, arguments))
        }

        function l() {
            var e = d3.touches(this),
                n = Date.now();
            v = d, p = {}, e.forEach(function (e) {
                p[e.identifier] = t(e)
            }), M();
            if (e.length === 1) {
                if (n - S < 500) {
                    var o = e[0],
                        u = t(e[0]);
                    r(d * 2), i(o, u), s(g.of(this, arguments))
                }
                S = n
            }
        }

        function c() {
            var e = d3.touches(this),
                t = e[0],
                n = p[t.identifier];
            if (o = e[1]) {
                var o, u = p[o.identifier];
                t = [(t[0] + o[0]) / 2, (t[1] + o[1]) / 2], n = [(n[0] + u[0]) / 2, (n[1] + u[1]) / 2], r(d3.event.scale * v)
            }
            i(t, n), S = null, s(g.of(this, arguments))
        }
        var h = [0, 0],
            p, d = 1,
            v, m = lo,
            g = D(e, "zoom"),
            y, b, w, E, S;
        return e.translate = function (t) {
            return arguments.length ? (h = t.map(Number), e) : h
        }, e.scale = function (t) {
            return arguments.length ? (d = +t, e) : d
        }, e.scaleExtent = function (t) {
            return arguments.length ? (m = t == null ? lo : t.map(Number), e) : m
        }, e.x = function (t) {
            return arguments.length ? (b = t, y = t.copy(), e) : b
        }, e.y = function (t) {
            return arguments.length ? (E = t, w = t.copy(), e) : E
        }, d3.rebind(e, g, "on")
    };
    var fo, lo = [0, Infinity];
    d3.layout = {}, d3.layout.bundle = function () {
        return function (e) {
            var t = [],
                n = -1,
                r = e.length;
            while (++n < r) t.push(zn(e[n]));
            return t
        }
    }, d3.layout.chord = function () {
        function e() {
            var e = {}, n = [],
                c = d3.range(o),
                h = [],
                p, d, v, m, g;
            r = [], i = [], p = 0, m = -1;
            while (++m < o) {
                d = 0, g = -1;
                while (++g < o) d += s[m][g];
                n.push(d), h.push(d3.range(o)), p += d
            }
            a && c.sort(function (e, t) {
                return a(n[e], n[t])
            }), f && h.forEach(function (e, t) {
                e.sort(function (e, n) {
                    return f(s[t][e], s[t][n])
                })
            }), p = (2 * Math.PI - u * o) / p, d = 0, m = -1;
            while (++m < o) {
                v = d, g = -1;
                while (++g < o) {
                    var y = c[m],
                        b = h[y][g],
                        w = s[y][b],
                        E = d,
                        S = d += w * p;
                    e[y + "-" + b] = {
                        index: y,
                        subindex: b,
                        startAngle: E,
                        endAngle: S,
                        value: w
                    }
                }
                i[y] = {
                    index: y,
                    startAngle: v,
                    endAngle: d,
                    value: (d - v) / p
                }, d += u
            }
            m = -1;
            while (++m < o) {
                g = m - 1;
                while (++g < o) {
                    var x = e[m + "-" + g],
                        T = e[g + "-" + m];
                    (x.value || T.value) && r.push(x.value < T.value ? {
                            source: T,
                            target: x
                        } : {
                            source: x,
                            target: T
                        })
                }
            }
            l && t()
        }

        function t() {
            r.sort(function (e, t) {
                return l((e.source.value + e.target.value) / 2, (t.source.value + t.target.value) / 2)
            })
        }
        var n = {}, r, i, s, o, u = 0,
            a, f, l;
        return n.matrix = function (e) {
            return arguments.length ? (o = (s = e) && s.length, r = i = null, n) : s
        }, n.padding = function (e) {
            return arguments.length ? (u = e, r = i = null, n) : u
        }, n.sortGroups = function (e) {
            return arguments.length ? (a = e, r = i = null, n) : a
        }, n.sortSubgroups = function (e) {
            return arguments.length ? (f = e, r = null, n) : f
        }, n.sortChords = function (e) {
            return arguments.length ? (l = e, r && t(), n) : l
        }, n.chords = function () {
            return r || e(), r
        }, n.groups = function () {
            return i || e(), i
        }, n
    }, d3.layout.force = function () {
        function e(e) {
            return function (t, n, r, i, s) {
                if (t.point !== e) {
                    var o = t.cx - e.x,
                        u = t.cy - e.y,
                        a = 1 / Math.sqrt(o * o + u * u);
                    if ((i - n) * a < d) {
                        var f = t.charge * a * a;
                        return e.px -= o * f, e.py -= u * f, !0
                    }
                    if (t.point && isFinite(a)) {
                        var f = t.pointCharge * a * a;
                        e.px -= o * f, e.py -= u * f
                    }
                }
                return !t.charge
            }
        }

        function t(e) {
            e.px = d3.event.x, e.py = d3.event.y, n.resume()
        }
        var n = {}, r = d3.dispatch("start", "tick", "end"),
            s = [1, 1],
            o, a, f = .9,
            l = Gn,
            c = Yn,
            h = -30,
            p = .1,
            d = .8,
            v, m = [],
            g = [],
            y, b, w;
        return n.tick = function () {
            if ((a *= .99) < .005) return r.end({
                type: "end",
                alpha: a = 0
            }), !0;
            var t = m.length,
                n = g.length,
                i, o, u, l, c, d, v, E, S;
            for (o = 0; o < n; ++o) {
                u = g[o], l = u.source, c = u.target, E = c.x - l.x, S = c.y - l.y;
                if (d = E * E + S * S) d = a * b[o] * ((d = Math.sqrt(d)) - y[o]) / d, E *= d, S *= d, c.x -= E * (v = l.weight / (c.weight + l.weight)), c.y -= S * v, l.x += E * (v = 1 - v), l.y += S * v
            }
            if (v = a * p) {
                E = s[0] / 2, S = s[1] / 2, o = -1;
                if (v)
                    while (++o < t) u = m[o], u.x += (E - u.x) * v, u.y += (S - u.y) * v
            }
            if (h) {
                Qn(i = d3.geom.quadtree(m), a, w), o = -1;
                while (++o < t)(u = m[o]).fixed || i.visit(e(u))
            }
            o = -1;
            while (++o < t) u = m[o], u.fixed ? (u.x = u.px, u.y = u.py) : (u.x -= (u.px - (u.px = u.x)) * f, u.y -= (u.py - (u.py = u.y)) * f);
            r.tick({
                type: "tick",
                alpha: a
            })
        }, n.nodes = function (e) {
            return arguments.length ? (m = e, n) : m
        }, n.links = function (e) {
            return arguments.length ? (g = e, n) : g
        }, n.size = function (e) {
            return arguments.length ? (s = e, n) : s
        }, n.linkDistance = function (e) {
            return arguments.length ? (l = u(e), n) : l
        }, n.distance = n.linkDistance, n.linkStrength = function (e) {
            return arguments.length ? (c = u(e), n) : c
        }, n.friction = function (e) {
            return arguments.length ? (f = e, n) : f
        }, n.charge = function (e) {
            return arguments.length ? (h = typeof e == "function" ? e : +e, n) : h
        }, n.gravity = function (e) {
            return arguments.length ? (p = e, n) : p
        }, n.theta = function (e) {
            return arguments.length ? (d = e, n) : d
        }, n.alpha = function (e) {
            return arguments.length ? (a ? e > 0 ? a = e : a = 0 : e > 0 && (r.start({
                type: "start",
                alpha: a = e
            }), d3.timer(n.tick)), n) : a
        }, n.start = function () {
            function e(e, n) {
                var i = t(r),
                    s = -1,
                    o = i.length,
                    u;
                while (++s < o)
                    if (!isNaN(u = i[s][e])) return u;
                return Math.random() * n
            }

            function t() {
                if (!p) {
                    p = [];
                    for (i = 0; i < o; ++i) p[i] = [];
                    for (i = 0; i < u; ++i) {
                        var e = g[i];
                        p[e.source.index].push(e.target), p[e.target.index].push(e.source)
                    }
                }
                return p[r]
            }
            var r, i, o = m.length,
                u = g.length,
                a = s[0],
                f = s[1],
                p, d;
            for (r = 0; r < o; ++r)(d = m[r]).index = r, d.weight = 0;
            y = [], b = [];
            for (r = 0; r < u; ++r) d = g[r], typeof d.source == "number" && (d.source = m[d.source]), typeof d.target == "number" && (d.target = m[d.target]), y[r] = l.call(this, d, r), b[r] = c.call(this, d, r), ++d.source.weight, ++d.target.weight;
            for (r = 0; r < o; ++r) d = m[r], isNaN(d.x) && (d.x = e("x", a)), isNaN(d.y) && (d.y = e("y", f)), isNaN(d.px) && (d.px = d.x), isNaN(d.py) && (d.py = d.y);
            w = [];
            if (typeof h == "function")
                for (r = 0; r < o; ++r) w[r] = +h.call(this, m[r], r);
            else
                for (r = 0; r < o; ++r) w[r] = h;
            return n.resume()
        }, n.resume = function () {
            return n.alpha(.1)
        }, n.stop = function () {
            return n.alpha(0)
        }, n.drag = function () {
            o || (o = d3.behavior.drag().origin(i).on("dragstart", Vn).on("drag", t).on("dragend", $n)), this.on("mouseover.force", Jn).on("mouseout.force", Kn).call(o)
        }, d3.rebind(n, r, "on")
    }, d3.layout.partition = function () {
        function e(t, n, r, i) {
            var s = t.children;
            t.x = n, t.y = t.depth * i, t.dx = r, t.dy = i;
            if (s && (u = s.length)) {
                var o = -1,
                    u, a, f;
                r = t.value ? r / t.value : 0;
                while (++o < u) e(a = s[o], n, f = a.value * r, i), n += f
            }
        }

        function t(e) {
            var n = e.children,
                r = 0;
            if (n && (s = n.length)) {
                var i = -1,
                    s;
                while (++i < s) r = Math.max(r, t(n[i]))
            }
            return 1 + r
        }

        function n(n, s) {
            var o = r.call(this, n, s);
            return e(o[0], 0, i[0], i[1] / t(o[0])), o
        }
        var r = d3.layout.hierarchy(),
            i = [1, 1];
        return n.size = function (e) {
            return arguments.length ? (i = e, n) : i
        }, lr(n, r)
    }, d3.layout.pie = function () {
        function e(s, o) {
            var u = s.map(function (n, r) {
                return +t.call(e, n, r)
            }),
                a = +(typeof r == "function" ? r.apply(this, arguments) : r),
                f = ((typeof i == "function" ? i.apply(this, arguments) : i) - r) / d3.sum(u),
                l = d3.range(s.length);
            n != null && l.sort(n === co ? function (e, t) {
                return u[t] - u[e]
            } : function (e, t) {
                return n(s[e], s[t])
            });
            var c = [];
            return l.forEach(function (e) {
                var t;
                c[e] = {
                    data: s[e],
                    value: t = u[e],
                    startAngle: a,
                    endAngle: a += t * f
                }
            }), c
        }
        var t = Number,
            n = co,
            r = 0,
            i = 2 * Math.PI;
        return e.value = function (n) {
            return arguments.length ? (t = n, e) : t
        }, e.sort = function (t) {
            return arguments.length ? (n = t, e) : n
        }, e.startAngle = function (t) {
            return arguments.length ? (r = t, e) : r
        }, e.endAngle = function (t) {
            return arguments.length ? (i = t, e) : i
        }, e
    };
    var co = {};
    d3.layout.stack = function () {
        function e(i, a) {
            var f = i.map(function (n, r) {
                return t.call(e, n, r)
            }),
                l = f.map(function (t, n) {
                    return t.map(function (t, n) {
                        return [o.call(e, t, n), u.call(e, t, n)]
                    })
                }),
                c = n.call(e, l, a);
            f = d3.permute(f, c), l = d3.permute(l, c);
            var h = r.call(e, l, a),
                p = f.length,
                d = f[0].length,
                v, m, g;
            for (m = 0; m < d; ++m) {
                s.call(e, f[0][m], g = h[m], l[0][m][1]);
                for (v = 1; v < p; ++v) s.call(e, f[v][m], g += l[v - 1][m][1], l[v][m][1])
            }
            return i
        }
        var t = i,
            n = nr,
            r = rr,
            s = tr,
            o = Zn,
            u = er;
        return e.values = function (n) {
            return arguments.length ? (t = n, e) : t
        }, e.order = function (t) {
            return arguments.length ? (n = typeof t == "function" ? t : ho.get(t) || nr, e) : n
        }, e.offset = function (t) {
            return arguments.length ? (r = typeof t == "function" ? t : po.get(t) || rr, e) : r
        }, e.x = function (t) {
            return arguments.length ? (o = t, e) : o
        }, e.y = function (t) {
            return arguments.length ? (u = t, e) : u
        }, e.out = function (t) {
            return arguments.length ? (s = t, e) : s
        }, e
    };
    var ho = d3.map({
        "inside-out": function (e) {
            var t = e.length,
                n, r, i = e.map(ir),
                s = e.map(sr),
                o = d3.range(t).sort(function (e, t) {
                    return i[e] - i[t]
                }),
                u = 0,
                a = 0,
                f = [],
                l = [];
            for (n = 0; n < t; ++n) r = o[n], u < a ? (u += s[r], f.push(r)) : (a += s[r], l.push(r));
            return l.reverse().concat(f)
        },
        reverse: function (e) {
            return d3.range(e.length).reverse()
        },
        "default": nr
    }),
        po = d3.map({
            silhouette: function (e) {
                var t = e.length,
                    n = e[0].length,
                    r = [],
                    i = 0,
                    s, o, u, a = [];
                for (o = 0; o < n; ++o) {
                    for (s = 0, u = 0; s < t; s++) u += e[s][o][1];
                    u > i && (i = u), r.push(u)
                }
                for (o = 0; o < n; ++o) a[o] = (i - r[o]) / 2;
                return a
            },
            wiggle: function (e) {
                var t = e.length,
                    n = e[0],
                    r = n.length,
                    i = 0,
                    s, o, u, a, f, l, c, h, p, d = [];
                d[0] = h = p = 0;
                for (o = 1; o < r; ++o) {
                    for (s = 0, a = 0; s < t; ++s) a += e[s][o][1];
                    for (s = 0, f = 0, c = n[o][0] - n[o - 1][0]; s < t; ++s) {
                        for (u = 0, l = (e[s][o][1] - e[s][o - 1][1]) / (2 * c); u < s; ++u) l += (e[u][o][1] - e[u][o - 1][1]) / c;
                        f += l * e[s][o][1]
                    }
                    d[o] = h -= a ? f / a * c : 0, h < p && (p = h)
                }
                for (o = 0; o < r; ++o) d[o] -= p;
                return d
            },
            expand: function (e) {
                var t = e.length,
                    n = e[0].length,
                    r = 1 / t,
                    i, s, o, u = [];
                for (s = 0; s < n; ++s) {
                    for (i = 0, o = 0; i < t; i++) o += e[i][s][1];
                    if (o)
                        for (i = 0; i < t; i++) e[i][s][1] /= o;
                    else
                        for (i = 0; i < t; i++) e[i][s][1] = r
                }
                for (s = 0; s < n; ++s) u[s] = 0;
                return u
            },
            zero: rr
        });
    d3.layout.histogram = function () {
        function e(e, s) {
            var o = [],
                u = e.map(n, this),
                a = r.call(this, u, s),
                f = i.call(this, a, u, s),
                l, s = -1,
                c = u.length,
                h = f.length - 1,
                p = t ? 1 : 1 / c,
                d;
            while (++s < h) l = o[s] = [], l.dx = f[s + 1] - (l.x = f[s]), l.y = 0;
            if (h > 0) {
                s = -1;
                while (++s < c) d = u[s], d >= a[0] && d <= a[1] && (l = o[d3.bisect(f, d, 1, h) - 1], l.y += p, l.push(e[s]))
            }
            return o
        }
        var t = !0,
            n = Number,
            r = fr,
            i = ur;
        return e.value = function (t) {
            return arguments.length ? (n = t, e) : n
        }, e.range = function (t) {
            return arguments.length ? (r = u(t), e) : r
        }, e.bins = function (t) {
            return arguments.length ? (i = typeof t == "number" ? function (e) {
                return ar(e, t)
            } : u(t), e) : i
        }, e.frequency = function (n) {
            return arguments.length ? (t = !! n, e) : t
        }, e
    }, d3.layout.hierarchy = function () {
        function e(t, o, u) {
            var a = i.call(n, t, o),
                f = vo ? t : {
                    data: t
                };
            f.depth = o, u.push(f);
            if (a && (c = a.length)) {
                var l = -1,
                    c, h = f.children = [],
                    p = 0,
                    d = o + 1,
                    v;
                while (++l < c) v = e(a[l], d, u), v.parent = f, h.push(v), p += v.value;
                r && h.sort(r), s && (f.value = p)
            } else s && (f.value = +s.call(n, t, o) || 0);
            return f
        }

        function t(e, r) {
            var i = e.children,
                o = 0;
            if (i && (a = i.length)) {
                var u = -1,
                    a, f = r + 1;
                while (++u < a) o += t(i[u], f)
            } else s && (o = +s.call(n, vo ? e : e.data, r) || 0);
            return s && (e.value = o), o
        }

        function n(t) {
            var n = [];
            return e(t, 0, n), n
        }
        var r = pr,
            i = cr,
            s = hr;
        return n.sort = function (e) {
            return arguments.length ? (r = e, n) : r
        }, n.children = function (e) {
            return arguments.length ? (i = e, n) : i
        }, n.value = function (e) {
            return arguments.length ? (s = e, n) : s
        }, n.revalue = function (e) {
            return t(e, 0), e
        }, n
    };
    var vo = !1;
    d3.layout.pack = function () {
        function e(e, i) {
            var s = t.call(this, e, i),
                o = s[0];
            o.x = 0, o.y = 0, Hr(o, function (e) {
                e.r = Math.sqrt(e.value)
            }), Hr(o, br);
            var u = r[0],
                a = r[1],
                f = Math.max(2 * o.r / u, 2 * o.r / a);
            if (n > 0) {
                var l = n * f / 2;
                Hr(o, function (e) {
                    e.r += l
                }), Hr(o, br), Hr(o, function (e) {
                    e.r -= l
                }), f = Math.max(2 * o.r / u, 2 * o.r / a)
            }
            return Sr(o, u / 2, a / 2, 1 / f), s
        }
        var t = d3.layout.hierarchy().sort(vr),
            n = 0,
            r = [1, 1];
        return e.size = function (t) {
            return arguments.length ? (r = t, e) : r
        }, e.padding = function (t) {
            return arguments.length ? (n = +t, e) : n
        }, lr(e, t)
    }, d3.layout.cluster = function () {
        function e(e, i) {
            var s = t.call(this, e, i),
                o = s[0],
                u, a = 0,
                f, l;
            Hr(o, function (e) {
                var t = e.children;
                t && t.length ? (e.x = Nr(t), e.y = Tr(t)) : (e.x = u ? a += n(e, u) : 0, e.y = 0, u = e)
            });
            var c = Cr(o),
                h = kr(o),
                p = c.x - n(c, h) / 2,
                d = h.x + n(h, c) / 2;
            return Hr(o, function (e) {
                e.x = (e.x - p) / (d - p) * r[0], e.y = (1 - (o.y ? e.y / o.y : 1)) * r[1]
            }), s
        }
        var t = d3.layout.hierarchy().sort(null).value(null),
            n = Lr,
            r = [1, 1];
        return e.separation = function (t) {
            return arguments.length ? (n = t, e) : n
        }, e.size = function (t) {
            return arguments.length ? (r = t, e) : r
        }, lr(e, t)
    }, d3.layout.tree = function () {
        function e(e, i) {
            function s(e, t) {
                var r = e.children,
                    i = e._tree;
                if (r && (o = r.length)) {
                    var o, a = r[0],
                        f, l = a,
                        c, h = -1;
                    while (++h < o) c = r[h], s(c, f), l = u(c, f, l), f = c;
                    Br(e);
                    var p = .5 * (a._tree.prelim + c._tree.prelim);
                    t ? (i.prelim = t._tree.prelim + n(e, t), i.mod = i.prelim - p) : i.prelim = p
                } else t && (i.prelim = t._tree.prelim + n(e, t))
            }

            function o(e, t) {
                e.x = e._tree.prelim + t;
                var n = e.children;
                if (n && (i = n.length)) {
                    var r = -1,
                        i;
                    t += e._tree.mod;
                    while (++r < i) o(n[r], t)
                }
            }

            function u(e, t, r) {
                if (t) {
                    var i = e,
                        s = e,
                        o = t,
                        u = e.parent.children[0],
                        a = i._tree.mod,
                        f = s._tree.mod,
                        l = o._tree.mod,
                        c = u._tree.mod,
                        h;
                    while (o = Or(o), i = Ar(i), o && i) u = Ar(u), s = Or(s), s._tree.ancestor = e, h = o._tree.prelim + l - i._tree.prelim - a + n(o, i), h > 0 && (jr(Fr(o, e, r), e, h), a += h, f += h), l += o._tree.mod, a += i._tree.mod, c += u._tree.mod, f += s._tree.mod;
                    o && !Or(s) && (s._tree.thread = o, s._tree.mod += l - f), i && !Ar(u) && (u._tree.thread = i, u._tree.mod += a - c, r = e)
                }
                return r
            }
            var a = t.call(this, e, i),
                f = a[0];
            Hr(f, function (e, t) {
                e._tree = {
                    ancestor: e,
                    prelim: 0,
                    mod: 0,
                    change: 0,
                    shift: 0,
                    number: t ? t._tree.number + 1 : 0
                }
            }), s(f), o(f, -f._tree.prelim);
            var l = Mr(f, Dr),
                c = Mr(f, _r),
                h = Mr(f, Pr),
                p = l.x - n(l, c) / 2,
                d = c.x + n(c, l) / 2,
                v = h.depth || 1;
            return Hr(f, function (e) {
                e.x = (e.x - p) / (d - p) * r[0], e.y = e.depth / v * r[1], delete e._tree
            }), a
        }
        var t = d3.layout.hierarchy().sort(null).value(null),
            n = Lr,
            r = [1, 1];
        return e.separation = function (t) {
            return arguments.length ? (n = t, e) : n
        }, e.size = function (t) {
            return arguments.length ? (r = t, e) : r
        }, lr(e, t)
    }, d3.layout.treemap = function () {
        function e(e, t) {
            var n = -1,
                r = e.length,
                i, s;
            while (++n < r) s = (i = e[n]).value * (t < 0 ? 0 : t), i.area = isNaN(s) || s <= 0 ? 0 : s
        }

        function t(n) {
            var s = n.children;
            if (s && s.length) {
                var o = l(n),
                    u = [],
                    a = s.slice(),
                    f, c = Infinity,
                    h, p = Math.min(o.dx, o.dy),
                    d;
                e(a, o.dx * o.dy / n.value), u.area = 0;
                while ((d = a.length) > 0) u.push(f = a[d - 1]), u.area += f.area, (h = r(u, p)) <= c ? (a.pop(), c = h) : (u.area -= u.pop().area, i(u, p, o, !1), p = Math.min(o.dx, o.dy), u.length = u.area = 0, c = Infinity);
                u.length && (i(u, p, o, !0), u.length = u.area = 0), s.forEach(t)
            }
        }

        function n(t) {
            var r = t.children;
            if (r && r.length) {
                var s = l(t),
                    o = r.slice(),
                    u, a = [];
                e(o, s.dx * s.dy / t.value), a.area = 0;
                while (u = o.pop()) a.push(u), a.area += u.area, u.z != null && (i(a, u.z ? s.dx : s.dy, s, !o.length), a.length = a.area = 0);
                r.forEach(n)
            }
        }

        function r(e, t) {
            var n = e.area,
                r, i = 0,
                s = Infinity,
                o = -1,
                u = e.length;
            while (++o < u) {
                if (!(r = e[o].area)) continue;
                r < s && (s = r), r > i && (i = r)
            }
            return n *= n, t *= t, n ? Math.max(t * i * p / n, n / (t * s * p)) : Infinity
        }

        function i(e, t, n, r) {
            var i = -1,
                s = e.length,
                o = n.x,
                a = n.y,
                f = t ? u(e.area / t) : 0,
                l;
            if (t == n.dx) {
                if (r || f > n.dy) f = n.dy;
                while (++i < s) l = e[i], l.x = o, l.y = a, l.dy = f, o += l.dx = Math.min(n.x + n.dx - o, f ? u(l.area / f) : 0);
                l.z = !0, l.dx += n.x + n.dx - o, n.y += f, n.dy -= f
            } else {
                if (r || f > n.dx) f = n.dx;
                while (++i < s) l = e[i], l.x = o, l.y = a, l.dx = f, a += l.dy = Math.min(n.y + n.dy - a, f ? u(l.area / f) : 0);
                l.z = !1, l.dy += n.y + n.dy - a, n.x += f, n.dx -= f
            }
        }

        function s(r) {
            var i = h || o(r),
                s = i[0];
            return s.x = 0, s.y = 0, s.dx = a[0], s.dy = a[1], h && o.revalue(s), e([s], s.dx * s.dy / s.value), (h ? n : t)(s), c && (h = i), i
        }
        var o = d3.layout.hierarchy(),
            u = Math.round,
            a = [1, 1],
            f = null,
            l = Ir,
            c = !1,
            h, p = .5 * (1 + Math.sqrt(5));
        return s.size = function (e) {
            return arguments.length ? (a = e, s) : a
        }, s.padding = function (e) {
            function t(t) {
                var n = e.call(s, t, t.depth);
                return n == null ? Ir(t) : qr(t, typeof n == "number" ? [n, n, n, n] : n)
            }

            function n(t) {
                return qr(t, e)
            }
            if (!arguments.length) return f;
            var r;
            return l = (f = e) == null ? Ir : (r = typeof e) === "function" ? t : r === "number" ? (e = [e, e, e, e], n) : n, s
        }, s.round = function (e) {
            return arguments.length ? (u = e ? Math.round : Number, s) : u != Number
        }, s.sticky = function (e) {
            return arguments.length ? (c = e, h = null, s) : c
        }, s.ratio = function (e) {
            return arguments.length ? (p = e, s) : p
        }, lr(s, o)
    }, d3.csv = Rr(",", "text/csv"), d3.tsv = Rr("	", "text/tab-separated-values"), d3.geo = {};
    var mo = Math.PI / 180;
    d3.geo.azimuthal = function () {
        function e(e) {
            var n = e[0] * mo - s,
                o = e[1] * mo,
                f = Math.cos(n),
                l = Math.sin(n),
                c = Math.cos(o),
                h = Math.sin(o),
                p = t !== "orthographic" ? a * h + u * c * f : null,
                d, v = t === "stereographic" ? 1 / (1 + p) : t === "gnomonic" ? 1 / p : t === "equidistant" ? (d = Math.acos(p), d ? d / Math.sin(d) : 0) : t === "equalarea" ? Math.sqrt(2 / (1 + p)) : 1,
                m = v * c * l,
                g = v * (a * c * f - u * h);
            return [r * m + i[0], r * g + i[1]]
        }
        var t = "orthographic",
            n, r = 200,
            i = [480, 250],
            s, o, u, a;
        return e.invert = function (e) {
            var n = (e[0] - i[0]) / r,
                o = (e[1] - i[1]) / r,
                f = Math.sqrt(n * n + o * o),
                l = t === "stereographic" ? 2 * Math.atan(f) : t === "gnomonic" ? Math.atan(f) : t === "equidistant" ? f : t === "equalarea" ? 2 * Math.asin(.5 * f) : Math.asin(f),
                c = Math.sin(l),
                h = Math.cos(l);
            return [(s + Math.atan2(n * c, f * u * h + o * a * c)) / mo, Math.asin(h * a - (f ? o * c * u / f : 0)) / mo]
        }, e.mode = function (n) {
            return arguments.length ? (t = n + "", e) : t
        }, e.origin = function (t) {
            return arguments.length ? (n = t, s = n[0] * mo, o = n[1] * mo, u = Math.cos(o), a = Math.sin(o), e) : n
        }, e.scale = function (t) {
            return arguments.length ? (r = +t, e) : r
        }, e.translate = function (t) {
            return arguments.length ? (i = [+t[0], +t[1]], e) : i
        }, e.origin([0, 0])
    }, d3.geo.albers = function () {
        function e(e) {
            var t = u * (mo * e[0] - o),
                n = Math.sqrt(a - 2 * u * Math.sin(mo * e[1])) / u;
            return [i * n * Math.sin(t) + s[0], i * (n * Math.cos(t) - f) + s[1]]
        }

        function t() {
            var t = mo * r[0],
                i = mo * r[1],
                s = mo * n[1],
                l = Math.sin(t),
                c = Math.cos(t);
            return o = mo * n[0], u = .5 * (l + Math.sin(i)), a = c * c + 2 * u * l, f = Math.sqrt(a - 2 * u * Math.sin(s)) / u, e
        }
        var n = [-98, 38],
            r = [29.5, 45.5],
            i = 1e3,
            s = [480, 250],
            o, u, a, f;
        return e.invert = function (e) {
            var t = (e[0] - s[0]) / i,
                n = (e[1] - s[1]) / i,
                r = f + n,
                l = Math.atan2(t, r),
                c = Math.sqrt(t * t + r * r);
            return [(o + l / u) / mo, Math.asin((a - c * c * u * u) / (2 * u)) / mo]
        }, e.origin = function (e) {
            return arguments.length ? (n = [+e[0], +e[1]], t()) : n
        }, e.parallels = function (e) {
            return arguments.length ? (r = [+e[0], +e[1]], t()) : r
        }, e.scale = function (t) {
            return arguments.length ? (i = +t, e) : i
        }, e.translate = function (t) {
            return arguments.length ? (s = [+t[0], +t[1]], e) : s
        }, t()
    }, d3.geo.albersUsa = function () {
        function e(e) {
            var s = e[0],
                o = e[1];
            return (o > 50 ? n : s < -140 ? r : o < 21 ? i : t)(e)
        }
        var t = d3.geo.albers(),
            n = d3.geo.albers().origin([-160, 60]).parallels([55, 65]),
            r = d3.geo.albers().origin([-160, 20]).parallels([8, 18]),
            i = d3.geo.albers().origin([-60, 10]).parallels([8, 18]);
        return e.scale = function (s) {
            return arguments.length ? (t.scale(s), n.scale(s * .6), r.scale(s), i.scale(s * 1.5), e.translate(t.translate())) : t.scale()
        }, e.translate = function (s) {
            if (!arguments.length) return t.translate();
            var o = t.scale() / 1e3,
                u = s[0],
                a = s[1];
            return t.translate(s), n.translate([u - 400 * o, a + 170 * o]), r.translate([u - 190 * o, a + 200 * o]), i.translate([u + 580 * o, a + 430 * o]), e
        }, e.scale(t.scale())
    }, d3.geo.bonne = function () {
        function e(e) {
            var u = e[0] * mo - r,
                a = e[1] * mo - i;
            if (s) {
                var f = o + s - a,
                    l = u * Math.cos(a) / f;
                u = f * Math.sin(l), a = f * Math.cos(l) - o
            } else u *= Math.cos(a), a *= -1;
            return [t * u + n[0], t * a + n[1]]
        }
        var t = 200,
            n = [480, 250],
            r, i, s, o;
        return e.invert = function (e) {
            var i = (e[0] - n[0]) / t,
                u = (e[1] - n[1]) / t;
            if (s) {
                var a = o + u,
                    f = Math.sqrt(i * i + a * a);
                u = o + s - f, i = r + f * Math.atan2(i, a) / Math.cos(u)
            } else u *= -1, i /= Math.cos(u);
            return [i / mo, u / mo]
        }, e.parallel = function (t) {
            return arguments.length ? (o = 1 / Math.tan(s = t * mo), e) : s / mo
        }, e.origin = function (t) {
            return arguments.length ? (r = t[0] * mo, i = t[1] * mo, e) : [r / mo, i / mo]
        }, e.scale = function (n) {
            return arguments.length ? (t = +n, e) : t
        }, e.translate = function (t) {
            return arguments.length ? (n = [+t[0], +t[1]], e) : n
        }, e.origin([0, 0]).parallel(45)
    }, d3.geo.equirectangular = function () {
        function e(e) {
            var r = e[0] / 360,
                i = -e[1] / 360;
            return [t * r + n[0], t * i + n[1]]
        }
        var t = 500,
            n = [480, 250];
        return e.invert = function (e) {
            var r = (e[0] - n[0]) / t,
                i = (e[1] - n[1]) / t;
            return [360 * r, -360 * i]
        }, e.scale = function (n) {
            return arguments.length ? (t = +n, e) : t
        }, e.translate = function (t) {
            return arguments.length ? (n = [+t[0], +t[1]], e) : n
        }, e
    }, d3.geo.mercator = function () {
        function e(e) {
            var r = e[0] / 360,
                i = -(Math.log(Math.tan(Math.PI / 4 + e[1] * mo / 2)) / mo) / 360;
            return [t * r + n[0], t * Math.max(-0.5, Math.min(.5, i)) + n[1]]
        }
        var t = 500,
            n = [480, 250];
        return e.invert = function (e) {
            var r = (e[0] - n[0]) / t,
                i = (e[1] - n[1]) / t;
            return [360 * r, 2 * Math.atan(Math.exp(-360 * i * mo)) / mo - 90]
        }, e.scale = function (n) {
            return arguments.length ? (t = +n, e) : t
        }, e.translate = function (t) {
            return arguments.length ? (n = [+t[0], +t[1]], e) : n
        }, e
    }, d3.geo.path = function () {
        function e(e, t) {
            typeof s == "function" && (o = zr(s.apply(this, arguments))), f(e);
            var n = a.length ? a.join("") : null;
            return a = [], n
        }

        function t(e) {
            return u(e).join(",")
        }

        function n(e) {
            var t = i(e[0]),
                n = 0,
                r = e.length;
            while (++n < r) t -= i(e[n]);
            return t
        }

        function r(e) {
            var t = d3.geom.polygon(e[0].map(u)),
                n = t.area(),
                r = t.centroid(n < 0 ? (n *= -1, 1) : -1),
                i = r[0],
                s = r[1],
                o = n,
                a = 0,
                f = e.length;
            while (++a < f) t = d3.geom.polygon(e[a].map(u)), n = t.area(), r = t.centroid(n < 0 ? (n *= -1, 1) : -1), i -= r[0], s -= r[1], o -= n;
            return [i, s, 6 * o]
        }

        function i(e) {
            return Math.abs(d3.geom.polygon(e.map(u)).area())
        }
        var s = 4.5,
            o = zr(s),
            u = d3.geo.albersUsa(),
            a = [],
            f = Ur({
                FeatureCollection: function (e) {
                    var t = e.features,
                        n = -1,
                        r = t.length;
                    while (++n < r) a.push(f(t[n].geometry))
                },
                Feature: function (e) {
                    f(e.geometry)
                },
                Point: function (e) {
                    a.push("M", t(e.coordinates), o)
                },
                MultiPoint: function (e) {
                    var n = e.coordinates,
                        r = -1,
                        i = n.length;
                    while (++r < i) a.push("M", t(n[r]), o)
                },
                LineString: function (e) {
                    var n = e.coordinates,
                        r = -1,
                        i = n.length;
                    a.push("M");
                    while (++r < i) a.push(t(n[r]), "L");
                    a.pop()
                },
                MultiLineString: function (e) {
                    var n = e.coordinates,
                        r = -1,
                        i = n.length,
                        s, o, u;
                    while (++r < i) {
                        s = n[r], o = -1, u = s.length, a.push("M");
                        while (++o < u) a.push(t(s[o]), "L");
                        a.pop()
                    }
                },
                Polygon: function (e) {
                    var n = e.coordinates,
                        r = -1,
                        i = n.length,
                        s, o, u;
                    while (++r < i) {
                        s = n[r], o = -1;
                        if ((u = s.length - 1) > 0) {
                            a.push("M");
                            while (++o < u) a.push(t(s[o]), "L");
                            a[a.length - 1] = "Z"
                        }
                    }
                },
                MultiPolygon: function (e) {
                    var n = e.coordinates,
                        r = -1,
                        i = n.length,
                        s, o, u, f, l, c;
                    while (++r < i) {
                        s = n[r], o = -1, u = s.length;
                        while (++o < u) {
                            f = s[o], l = -1;
                            if ((c = f.length - 1) > 0) {
                                a.push("M");
                                while (++l < c) a.push(t(f[l]), "L");
                                a[a.length - 1] = "Z"
                            }
                        }
                    }
                },
                GeometryCollection: function (e) {
                    var t = e.geometries,
                        n = -1,
                        r = t.length;
                    while (++n < r) a.push(f(t[n]))
                }
            }),
            l = e.area = Ur({
                FeatureCollection: function (e) {
                    var t = 0,
                        n = e.features,
                        r = -1,
                        i = n.length;
                    while (++r < i) t += l(n[r]);
                    return t
                },
                Feature: function (e) {
                    return l(e.geometry)
                },
                Polygon: function (e) {
                    return n(e.coordinates)
                },
                MultiPolygon: function (e) {
                    var t = 0,
                        r = e.coordinates,
                        i = -1,
                        s = r.length;
                    while (++i < s) t += n(r[i]);
                    return t
                },
                GeometryCollection: function (e) {
                    var t = 0,
                        n = e.geometries,
                        r = -1,
                        i = n.length;
                    while (++r < i) t += l(n[r]);
                    return t
                }
            }, 0),
            c = e.centroid = Ur({
                Feature: function (e) {
                    return c(e.geometry)
                },
                Polygon: function (e) {
                    var t = r(e.coordinates);
                    return [t[0] / t[2], t[1] / t[2]]
                },
                MultiPolygon: function (e) {
                    var t = 0,
                        n = e.coordinates,
                        i, s = 0,
                        o = 0,
                        u = 0,
                        a = -1,
                        f = n.length;
                    while (++a < f) i = r(n[a]), s += i[0], o += i[1], u += i[2];
                    return [s / u, o / u]
                }
            });
        return e.projection = function (t) {
            return u = t, e
        }, e.pointRadius = function (t) {
            return typeof t == "function" ? s = t : (s = +t, o = zr(s)), e
        }, e
    }, d3.geo.bounds = function (e) {
        var t = Infinity,
            n = Infinity,
            r = -Infinity,
            i = -Infinity;
        return Wr(e, function (e, s) {
            e < t && (t = e), e > r && (r = e), s < n && (n = s), s > i && (i = s)
        }), [
            [t, n],
            [r, i]
        ]
    };
    var go = {
        Feature: Xr,
        FeatureCollection: Vr,
        GeometryCollection: $r,
        LineString: Jr,
        MultiLineString: Kr,
        MultiPoint: Jr,
        MultiPolygon: Qr,
        Point: Gr,
        Polygon: Yr
    };
    d3.geo.circle = function () {
        function e() {}

        function t(e) {
            return a.distance(e) < u
        }

        function n(e) {
            var t = -1,
                n = e.length,
                i = [],
                s, o, f, l, c;
            while (++t < n) c = a.distance(f = e[t]), c < u ? (o && i.push(ni(o, f)((l - u) / (l - c))), i.push(f), s = o = null) : (o = f, !s && i.length && (i.push(ni(i[i.length - 1], o)((u - l) / (c - l))), s = o)), l = c;
            return s = e[0], o = i[0], o && f[0] === s[0] && f[1] === s[1] && (f[0] !== o[0] || f[1] !== o[1]) && i.push(o), r(i)
        }

        function r(e) {
            var t = 0,
                n = e.length,
                r, i, s = n ? [e[0]] : e,
                o, u = a.source();
            while (++t < n) {
                o = a.source(e[t - 1])(e[t]).coordinates;
                for (r = 0, i = o.length; ++r < i;) s.push(o[r])
            }
            return a.source(u), s
        }
        var s = [0, 0],
            o = 89.99,
            u = o * mo,
            a = d3.geo.greatArc().source(s).target(i);
        e.clip = function (e) {
            return typeof s == "function" && a.source(s.apply(this, arguments)), f(e) || null
        };
        var f = Ur({
            FeatureCollection: function (e) {
                var t = e.features.map(f).filter(i);
                return t && (e = Object.create(e), e.features = t, e)
            },
            Feature: function (e) {
                var t = f(e.geometry);
                return t && (e = Object.create(e), e.geometry = t, e)
            },
            Point: function (e) {
                return t(e.coordinates) && e
            },
            MultiPoint: function (e) {
                var n = e.coordinates.filter(t);
                return n.length && {
                    type: e.type,
                    coordinates: n
                }
            },
            LineString: function (e) {
                var t = n(e.coordinates);
                return t.length && (e = Object.create(e), e.coordinates = t, e)
            },
            MultiLineString: function (e) {
                var t = e.coordinates.map(n).filter(function (e) {
                    return e.length
                });
                return t.length && (e = Object.create(e), e.coordinates = t, e)
            },
            Polygon: function (e) {
                var t = e.coordinates.map(n);
                return t[0].length && (e = Object.create(e), e.coordinates = t, e)
            },
            MultiPolygon: function (e) {
                var t = e.coordinates.map(function (e) {
                    return e.map(n)
                }).filter(function (e) {
                    return e[0].length
                });
                return t.length && (e = Object.create(e), e.coordinates = t, e)
            },
            GeometryCollection: function (e) {
                var t = e.geometries.map(f).filter(i);
                return t.length && (e = Object.create(e), e.geometries = t, e)
            }
        });
        return e.origin = function (t) {
            return arguments.length ? (s = t, typeof s != "function" && a.source(s), e) : s
        }, e.angle = function (t) {
            return arguments.length ? (u = (o = +t) * mo, e) : o
        }, d3.rebind(e, a, "precision")
    }, d3.geo.greatArc = function () {
        function e() {
            var t = e.distance.apply(this, arguments),
                r = 0,
                u = s / t,
                a = [n];
            while ((r += u) < 1) a.push(o(r));
            return a.push(i), {
                type: "LineString",
                coordinates: a
            }
        }
        var t = Zr,
            n, r = ei,
            i, s = 6 * mo,
            o = ti();
        return e.distance = function () {
            return typeof t == "function" && o.source(n = t.apply(this, arguments)), typeof r == "function" && o.target(i = r.apply(this, arguments)), o.distance()
        }, e.source = function (r) {
            return arguments.length ? (t = r, typeof t != "function" && o.source(n = t), e) : t
        }, e.target = function (t) {
            return arguments.length ? (r = t, typeof r != "function" && o.target(i = r), e) : r
        }, e.precision = function (t) {
            return arguments.length ? (s = t * mo, e) : s / mo
        }, e
    }, d3.geo.greatCircle = d3.geo.circle, d3.geom = {}, d3.geom.contour = function (e, t) {
        var n = t || ri(e),
            r = [],
            i = n[0],
            s = n[1],
            o = 0,
            u = 0,
            a = NaN,
            f = NaN,
            l = 0;
        do l = 0, e(i - 1, s - 1) && (l += 1), e(i, s - 1) && (l += 2), e(i - 1, s) && (l += 4), e(i, s) && (l += 8), l === 6 ? (o = f === -1 ? -1 : 1, u = 0) : l === 9 ? (o = 0, u = a === 1 ? -1 : 1) : (o = yo[l], u = bo[l]), o != a && u != f && (r.push([i, s]), a = o, f = u), i += o, s += u; while (n[0] != i || n[1] != s);
        return r
    };
    var yo = [1, 0, 1, 1, -1, 0, -1, 1, 0, 0, 0, 0, -1, 0, -1, NaN],
        bo = [0, -1, 0, 0, 0, -1, 0, 0, 1, -1, 1, 1, 0, -1, 0, NaN];
    d3.geom.hull = function (e) {
        if (e.length < 3) return [];
        var t = e.length,
            n = t - 1,
            r = [],
            i = [],
            s, o, u = 0,
            a, f, l, c, h, p, d, v;
        for (s = 1; s < t; ++s) e[s][1] < e[u][1] ? u = s : e[s][1] == e[u][1] && (u = e[s][0] < e[u][0] ? s : u);
        for (s = 0; s < t; ++s) {
            if (s === u) continue;
            f = e[s][1] - e[u][1], a = e[s][0] - e[u][0], r.push({
                angle: Math.atan2(f, a),
                index: s
            })
        }
        r.sort(function (e, t) {
            return e.angle - t.angle
        }), d = r[0].angle, p = r[0].index, h = 0;
        for (s = 1; s < n; ++s) o = r[s].index, d == r[s].angle ? (a = e[p][0] - e[u][0], f = e[p][1] - e[u][1], l = e[o][0] - e[u][0], c = e[o][1] - e[u][1], a * a + f * f >= l * l + c * c ? r[s].index = -1 : (r[h].index = -1, d = r[s].angle, h = s, p = o)) : (d = r[s].angle, h = s, p = o);
        i.push(u);
        for (s = 0, o = 0; s < 2; ++o) r[o].index !== -1 && (i.push(r[o].index), s++);
        v = i.length;
        for (; o < n; ++o) {
            if (r[o].index === -1) continue;
            while (!ii(i[v - 2], i[v - 1], r[o].index, e))--v;
            i[v++] = r[o].index
        }
        var m = [];
        for (s = 0; s < v; ++s) m.push(e[i[s]]);
        return m
    }, d3.geom.polygon = function (e) {
        return e.area = function () {
            var t = 0,
                n = e.length,
                r = e[n - 1][0] * e[0][1],
                i = e[n - 1][1] * e[0][0];
            while (++t < n) r += e[t - 1][0] * e[t][1], i += e[t - 1][1] * e[t][0];
            return (i - r) * .5
        }, e.centroid = function (t) {
            var n = -1,
                r = e.length,
                i = 0,
                s = 0,
                o, u = e[r - 1],
                a;
            arguments.length || (t = -1 / (6 * e.area()));
            while (++n < r) o = u, u = e[n], a = o[0] * u[1] - u[0] * o[1], i += (o[0] + u[0]) * a, s += (o[1] + u[1]) * a;
            return [i * t, s * t]
        }, e.clip = function (t) {
            var n, r = -1,
                i = e.length,
                s, o, u = e[i - 1],
                a, f, l;
            while (++r < i) {
                n = t.slice(), t.length = 0, a = e[r], f = n[(o = n.length) - 1], s = -1;
                while (++s < o) l = n[s], si(l, u, a) ? (si(f, u, a) || t.push(oi(f, l, u, a)), t.push(l)) : si(f, u, a) && t.push(oi(f, l, u, a)), f = l;
                u = a
            }
            return t
        }, e
    }, d3.geom.voronoi = function (e) {
        var t = e.map(function () {
            return []
        });
        return ui(e, function (e) {
            var n, r, i, s, o, u;
            e.a === 1 && e.b >= 0 ? (n = e.ep.r, r = e.ep.l) : (n = e.ep.l, r = e.ep.r), e.a === 1 ? (o = n ? n.y : -1e6, i = e.c - e.b * o, u = r ? r.y : 1e6, s = e.c - e.b * u) : (i = n ? n.x : -1e6, o = e.c - e.a * i, s = r ? r.x : 1e6, u = e.c - e.a * s);
            var a = [i, o],
                f = [s, u];
            t[e.region.l.index].push(a, f), t[e.region.r.index].push(a, f)
        }), t.map(function (t, n) {
            var r = e[n][0],
                i = e[n][1];
            return t.forEach(function (e) {
                e.angle = Math.atan2(e[0] - r, e[1] - i)
            }), t.sort(function (e, t) {
                return e.angle - t.angle
            }).filter(function (e, n) {
                return !n || e.angle - t[n - 1].angle > 1e-10
            })
        })
    };
    var wo = {
        l: "r",
        r: "l"
    };
    d3.geom.delaunay = function (e) {
        var t = e.map(function () {
            return []
        }),
            n = [];
        return ui(e, function (n) {
            t[n.region.l.index].push(e[n.region.r.index])
        }), t.forEach(function (t, r) {
            var i = e[r],
                s = i[0],
                o = i[1];
            t.forEach(function (e) {
                e.angle = Math.atan2(e[0] - s, e[1] - o)
            }), t.sort(function (e, t) {
                return e.angle - t.angle
            });
            for (var u = 0, a = t.length - 1; u < a; u++) n.push([i, t[u], t[u + 1]])
        }), n
    }, d3.geom.quadtree = function (e, t, n, r, i) {
        function s(e, t, n, r, i, s) {
            if (isNaN(t.x) || isNaN(t.y)) return;
            if (e.leaf) {
                var u = e.point;
                u ? Math.abs(u.x - t.x) + Math.abs(u.y - t.y) < .01 ? o(e, t, n, r, i, s) : (e.point = null, o(e, u, n, r, i, s), o(e, t, n, r, i, s)) : e.point = t
            } else o(e, t, n, r, i, s)
        }

        function o(e, t, n, r, i, o) {
            var u = (n + i) * .5,
                a = (r + o) * .5,
                f = t.x >= u,
                l = t.y >= a,
                c = (l << 1) + f;
            e.leaf = !1, e = e.nodes[c] || (e.nodes[c] = ai()), f ? n = u : i = u, l ? r = a : o = a, s(e, t, n, r, i, o)
        }
        var u, a = -1,
            f = e.length;
        f && isNaN(e[0].x) && (e = e.map(li));
        if (arguments.length < 5)
            if (arguments.length === 3) i = r = n, n = t;
            else {
                t = n = Infinity, r = i = -Infinity;
                while (++a < f) u = e[a], u.x < t && (t = u.x), u.y < n && (n = u.y), u.x > r && (r = u.x), u.y > i && (i = u.y);
                var l = r - t,
                    c = i - n;
                l > c ? i = n + l : r = t + c
            }
        var h = ai();
        return h.add = function (e) {
            s(h, e, t, n, r, i)
        }, h.visit = function (e) {
            fi(e, h, t, n, r, i)
        }, e.forEach(h.add), h
    }, d3.time = {};
    var Eo = Date,
        So = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];
    ci.prototype = {
        getDate: function () {
            return this._.getUTCDate()
        },
        getDay: function () {
            return this._.getUTCDay()
        },
        getFullYear: function () {
            return this._.getUTCFullYear()
        },
        getHours: function () {
            return this._.getUTCHours()
        },
        getMilliseconds: function () {
            return this._.getUTCMilliseconds()
        },
        getMinutes: function () {
            return this._.getUTCMinutes()
        },
        getMonth: function () {
            return this._.getUTCMonth()
        },
        getSeconds: function () {
            return this._.getUTCSeconds()
        },
        getTime: function () {
            return this._.getTime()
        },
        getTimezoneOffset: function () {
            return 0
        },
        valueOf: function () {
            return this._.valueOf()
        },
        setDate: function () {
            xo.setUTCDate.apply(this._, arguments)
        },
        setDay: function () {
            xo.setUTCDay.apply(this._, arguments)
        },
        setFullYear: function () {
            xo.setUTCFullYear.apply(this._, arguments)
        },
        setHours: function () {
            xo.setUTCHours.apply(this._, arguments)
        },
        setMilliseconds: function () {
            xo.setUTCMilliseconds.apply(this._, arguments)
        },
        setMinutes: function () {
            xo.setUTCMinutes.apply(this._, arguments)
        },
        setMonth: function () {
            xo.setUTCMonth.apply(this._, arguments)
        },
        setSeconds: function () {
            xo.setUTCSeconds.apply(this._, arguments)
        },
        setTime: function () {
            xo.setTime.apply(this._, arguments)
        }
    };
    var xo = Date.prototype,
        To = "%a %b %e %H:%M:%S %Y",
        No = "%m/%d/%y",
        Co = "%H:%M:%S",
        ko = So,
        Lo = ko.map(hi),
        Ao = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],
        Oo = Ao.map(hi);
    d3.time.format = function (e) {
        function t(t) {
            var r = [],
                i = -1,
                s = 0,
                o, u;
            while (++i < n) e.charCodeAt(i) == 37 && (r.push(e.substring(s, i), (u = Ro[o = e.charAt(++i)]) ? u(t) : o), s = i + 1);
            return r.push(e.substring(s, i)), r.join("")
        }
        var n = e.length;
        return t.parse = function (t) {
            var n = {
                y: 1900,
                m: 0,
                d: 1,
                H: 0,
                M: 0,
                S: 0,
                L: 0
            }, r = pi(n, e, t, 0);
            if (r != t.length) return null;
            "p" in n && (n.H = n.H % 12 + n.p * 12);
            var i = new Eo;
            return i.setFullYear(n.y, n.m, n.d), i.setHours(n.H, n.M, n.S, n.L), i
        }, t.toString = function () {
            return e
        }, t
    };
    var Mo = d3.format("02d"),
        _o = d3.format("03d"),
        Do = d3.format("04d"),
        Po = d3.format("2d"),
        Ho = di(ko),
        Bo = di(Lo),
        jo = di(Ao),
        Fo = vi(Ao),
        Io = di(Oo),
        qo = vi(Oo),
        Ro = {
            a: function (e) {
                return Lo[e.getDay()]
            },
            A: function (e) {
                return ko[e.getDay()]
            },
            b: function (e) {
                return Oo[e.getMonth()]
            },
            B: function (e) {
                return Ao[e.getMonth()]
            },
            c: d3.time.format(To),
            d: function (e) {
                return Mo(e.getDate())
            },
            e: function (e) {
                return Po(e.getDate())
            },
            H: function (e) {
                return Mo(e.getHours())
            },
            I: function (e) {
                return Mo(e.getHours() % 12 || 12)
            },
            j: function (e) {
                return _o(1 + d3.time.dayOfYear(e))
            },
            L: function (e) {
                return _o(e.getMilliseconds())
            },
            m: function (e) {
                return Mo(e.getMonth() + 1)
            },
            M: function (e) {
                return Mo(e.getMinutes())
            },
            p: function (e) {
                return e.getHours() >= 12 ? "PM" : "AM"
            },
            S: function (e) {
                return Mo(e.getSeconds())
            },
            U: function (e) {
                return Mo(d3.time.sundayOfYear(e))
            },
            w: function (e) {
                return e.getDay()
            },
            W: function (e) {
                return Mo(d3.time.mondayOfYear(e))
            },
            x: d3.time.format(No),
            X: d3.time.format(Co),
            y: function (e) {
                return Mo(e.getFullYear() % 100)
            },
            Y: function (e) {
                return Do(e.getFullYear() % 1e4)
            },
            Z: Di,
            "%": function (e) {
                return "%"
            }
        }, Uo = {
            a: mi,
            A: gi,
            b: yi,
            B: bi,
            c: wi,
            d: ki,
            e: ki,
            H: Li,
            I: Li,
            L: Mi,
            m: Ci,
            M: Ai,
            p: _i,
            S: Oi,
            x: Ei,
            X: Si,
            y: Ti,
            Y: xi
        }, zo = /^\s*\d+/,
        Wo = d3.map({
            am: 0,
            pm: 1
        });
    d3.time.format.utc = function (e) {
        function t(e) {
            try {
                Eo = ci;
                var t = new Eo;
                return t._ = e, n(t)
            } finally {
                Eo = Date
            }
        }
        var n = d3.time.format(e);
        return t.parse = function (e) {
            try {
                Eo = ci;
                var t = n.parse(e);
                return t && t._
            } finally {
                Eo = Date
            }
        }, t.toString = n.toString, t
    };
    var Xo = d3.time.format.utc("%Y-%m-%dT%H:%M:%S.%LZ");
    d3.time.format.iso = Date.prototype.toISOString ? Pi : Xo, Pi.parse = function (e) {
        var t = new Date(e);
        return isNaN(t) ? null : t
    }, Pi.toString = Xo.toString, d3.time.second = Hi(function (e) {
        return new Eo(Math.floor(e / 1e3) * 1e3)
    }, function (e, t) {
        e.setTime(e.getTime() + Math.floor(t) * 1e3)
    }, function (e) {
        return e.getSeconds()
    }), d3.time.seconds = d3.time.second.range, d3.time.seconds.utc = d3.time.second.utc.range, d3.time.minute = Hi(function (e) {
        return new Eo(Math.floor(e / 6e4) * 6e4)
    }, function (e, t) {
        e.setTime(e.getTime() + Math.floor(t) * 6e4)
    }, function (e) {
        return e.getMinutes()
    }), d3.time.minutes = d3.time.minute.range, d3.time.minutes.utc = d3.time.minute.utc.range, d3.time.hour = Hi(function (e) {
        var t = e.getTimezoneOffset() / 60;
        return new Eo((Math.floor(e / 36e5 - t) + t) * 36e5)
    }, function (e, t) {
        e.setTime(e.getTime() + Math.floor(t) * 36e5)
    }, function (e) {
        return e.getHours()
    }), d3.time.hours = d3.time.hour.range, d3.time.hours.utc = d3.time.hour.utc.range, d3.time.day = Hi(function (e) {
        var t = new Eo(1970, 0);
        return t.setFullYear(e.getFullYear(), e.getMonth(), e.getDate()), t
    }, function (e, t) {
        e.setDate(e.getDate() + t)
    }, function (e) {
        return e.getDate() - 1
    }), d3.time.days = d3.time.day.range, d3.time.days.utc = d3.time.day.utc.range, d3.time.dayOfYear = function (e) {
        var t = d3.time.year(e);
        return Math.floor((e - t - (e.getTimezoneOffset() - t.getTimezoneOffset()) * 6e4) / 864e5)
    }, So.forEach(function (e, t) {
        e = e.toLowerCase(), t = 7 - t;
        var n = d3.time[e] = Hi(function (e) {
            return (e = d3.time.day(e)).setDate(e.getDate() - (e.getDay() + t) % 7), e
        }, function (e, t) {
            e.setDate(e.getDate() + Math.floor(t) * 7)
        }, function (e) {
            var n = d3.time.year(e).getDay();
            return Math.floor((d3.time.dayOfYear(e) + (n + t) % 7) / 7) - (n !== t)
        });
        d3.time[e + "s"] = n.range, d3.time[e + "s"].utc = n.utc.range, d3.time[e + "OfYear"] = function (e) {
            var n = d3.time.year(e).getDay();
            return Math.floor((d3.time.dayOfYear(e) + (n + t) % 7) / 7)
        }
    }), d3.time.week = d3.time.sunday, d3.time.weeks = d3.time.sunday.range, d3.time.weeks.utc = d3.time.sunday.utc.range, d3.time.weekOfYear = d3.time.sundayOfYear, d3.time.month = Hi(function (e) {
        return e = d3.time.day(e), e.setDate(1), e
    }, function (e, t) {
        e.setMonth(e.getMonth() + t)
    }, function (e) {
        return e.getMonth()
    }), d3.time.months = d3.time.month.range, d3.time.months.utc = d3.time.month.utc.range, d3.time.year = Hi(function (e) {
        return e = d3.time.day(e), e.setMonth(0, 1), e
    }, function (e, t) {
        e.setFullYear(e.getFullYear() + t)
    }, function (e) {
        return e.getFullYear()
    }), d3.time.years = d3.time.year.range, d3.time.years.utc = d3.time.year.utc.range;
    var Vo = [1e3, 5e3, 15e3, 3e4, 6e4, 3e5, 9e5, 18e5, 36e5, 108e5, 216e5, 432e5, 864e5, 1728e5, 6048e5, 2592e6, 7776e6, 31536e6],
        $o = [
            [d3.time.second, 1],
            [d3.time.second, 5],
            [d3.time.second, 15],
            [d3.time.second, 30],
            [d3.time.minute, 1],
            [d3.time.minute, 5],
            [d3.time.minute, 15],
            [d3.time.minute, 30],
            [d3.time.hour, 1],
            [d3.time.hour, 3],
            [d3.time.hour, 6],
            [d3.time.hour, 12],
            [d3.time.day, 1],
            [d3.time.day, 2],
            [d3.time.week, 1],
            [d3.time.month, 1],
            [d3.time.month, 3],
            [d3.time.year, 1]
        ],
        Jo = [
            [d3.time.format("%Y"),
                function (e) {
                    return !0
                }
            ],
            [d3.time.format("%B"),
                function (e) {
                    return e.getMonth()
                }
            ],
            [d3.time.format("%b %d"),
                function (e) {
                    return e.getDate() != 1
                }
            ],
            [d3.time.format("%a %d"),
                function (e) {
                    return e.getDay() && e.getDate() != 1
                }
            ],
            [d3.time.format("%I %p"),
                function (e) {
                    return e.getHours()
                }
            ],
            [d3.time.format("%I:%M"),
                function (e) {
                    return e.getMinutes()
                }
            ],
            [d3.time.format(":%S"),
                function (e) {
                    return e.getSeconds()
                }
            ],
            [d3.time.format(".%L"),
                function (e) {
                    return e.getMilliseconds()
                }
            ]
        ],
        Ko = d3.scale.linear(),
        Qo = qi(Jo);
    $o.year = function (e, t) {
        return Ko.domain(e.map(Ui)).ticks(t).map(Ri)
    }, d3.time.scale = function () {
        return ji(d3.scale.linear(), $o, Qo)
    };
    var Go = $o.map(function (e) {
        return [e[0].utc, e[1]]
    }),
        Yo = [
            [d3.time.format.utc("%Y"),
                function (e) {
                    return !0
                }
            ],
            [d3.time.format.utc("%B"),
                function (e) {
                    return e.getUTCMonth()
                }
            ],
            [d3.time.format.utc("%b %d"),
                function (e) {
                    return e.getUTCDate() != 1
                }
            ],
            [d3.time.format.utc("%a %d"),
                function (e) {
                    return e.getUTCDay() && e.getUTCDate() != 1
                }
            ],
            [d3.time.format.utc("%I %p"),
                function (e) {
                    return e.getUTCHours()
                }
            ],
            [d3.time.format.utc("%I:%M"),
                function (e) {
                    return e.getUTCMinutes()
                }
            ],
            [d3.time.format.utc(":%S"),
                function (e) {
                    return e.getUTCSeconds()
                }
            ],
            [d3.time.format.utc(".%L"),
                function (e) {
                    return e.getUTCMilliseconds()
                }
            ]
        ],
        Zo = qi(Yo);
    Go.year = function (e, t) {
        return Ko.domain(e.map(Wi)).ticks(t).map(zi)
    }, d3.time.scale.utc = function () {
        return ji(d3.scale.linear(), Go, Zo)
    }
}(),
function () {
    function i(e) {
        return _.chain(_.range(e, 10)).reverse().map(function (e) {
            return 'g[data-index="' + e + '"]'
        }).value().join(", ")
    }

    function s(e, t) {
        var n = e.getAttribute("class");
        return (n !== null ? n.replace(/color\d+/g, "") : "") + " color" + t
    }

    function a(e, t) {
        return _.chain(e).pluck("data").flatten().pluck(t).uniq().filter(function (e) {
            return e !== undefined && e !== null
        }).value().sort(d3.ascending)
    }

    function f(e, t, n, r) {
        r = r || u;
        var i = a(e, t);
        return d3.scale.ordinal().domain(i).rangeRoundBands(n, r)
    }

    function l(e, t, n) {
        return d3.scale.linear().domain(e).nice().rangeRound(t)
    }

    function c(e, t, n) {
        return d3.scale.pow().exponent(.65).domain(e).nice().rangeRound(t)
    }

    function h(e, t) {
        return d3.time.scale().domain(_.map(e, function (e) {
            return new Date(e)
        })).range(t)
    }

    function p(e, t) {
        var n = e[0],
            r = e[1],
            i, s;
        return n === r && (s = Math.max(Math.round(n / 10), 4), n -= s, r += s), i = r - n, n = n ? n - i / 10 : n, n = e[0] > 0 ? Math.max(n, 0) : n, r = r ? r + i / 10 : r, r = e[1] < 0 ? Math.min(r, 0) : r, [n, r]
    }

    function d(e, t, n, r) {
        var i, s = _.chain(t).pluck("data").flatten().value();
        return i = {
            x: d3.extent(s, function (e) {
                return e.x
            }),
            y: d3.extent(s, function (e) {
                return e.y
            })
        }, _.each([n, r], function (t, n) {
            var r = n ? "y" : "x",
                o;
            i[r] = d3.extent(s, function (e) {
                return e[r]
            });
            if (t === "ordinal") return;
            _.each([r + "Min", r + "Max"], function (n, s) {
                t !== "time" && (o = p(i[r])), i[r][s] = e.hasOwnProperty(n) && e[n] !== null ? e[n] : t !== "time" ? o[s] : i[r][s]
            })
        }), i
    }

    function v(e, t, n, r) {
        var i = e._options,
            s = d(i, t, n, r),
            o = {}, u = [i.axisPaddingLeft, e._width],
            a = [e._height, i.axisPaddingTop],
            p, v;
        return _.each([n, r], function (e, n) {
            var r = n === 0 ? "x" : "y",
                i = n === 0 ? u : a;
            switch (e) {
            case "ordinal":
                o[r] = f(t, r, i);
                break;
            case "linear":
                o[r] = l(s[r], i, r);
                break;
            case "exponential":
                o[r] = c(s[r], i, r);
                break;
            case "time":
                o[r] = h(s[r], i)
            }
        }), o
    }

    function y() {
        var e = document;
        return !!e.createElementNS && !! e.createElementNS("http://www.w3.org/2000/svg", "svg").createSVGRect
    }

    function e(e, t, n, r) {
        var i = this,
            s;
        i._options = r = _.defaults(r || {}, g);
        if (y() === !1) return r.unsupported(n);
        i._selector = n, i._container = d3.select(n), i._drawSvg(), t = _.clone(t), e && !t.type && (t.type = e), i.setData(t), d3.select(window).on("resize.for." + n, function () {
            s && clearTimeout(s), s = setTimeout(function () {
                s = null, i._resize()
            }, 500)
        })
    }
    var e, t = {}, n = {}, r = {};
    (function () {
        var e = this,
            t = e._,
            n = {}, r = Array.prototype,
            i = Object.prototype,
            s = Function.prototype,
            o = r.push,
            u = r.slice,
            a = r.concat,
            f = i.toString,
            l = i.hasOwnProperty,
            c = r.forEach,
            h = r.map,
            p = r.reduce,
            d = r.reduceRight,
            v = r.filter,
            m = r.every,
            g = r.some,
            y = r.indexOf,
            b = r.lastIndexOf,
            w = Array.isArray,
            E = Object.keys,
            S = s.bind,
            x = function (e) {
                return e instanceof x ? e : this instanceof x ? (this._wrapped = e, void 0) : new x(e)
            };
        "undefined" != typeof exports ? ("undefined" != typeof module && module.exports && (exports = module.exports = x), exports._ = x) : e._ = x, x.VERSION = "1.4.3";
        var T = x.each = x.forEach = function (e, t, r) {
            if (null != e)
                if (c && e.forEach === c) e.forEach(t, r);
                else if (e.length === +e.length) {
                for (var i = 0, s = e.length; s > i; i++)
                    if (t.call(r, e[i], i, e) === n) return
            } else
                for (var o in e)
                    if (x.has(e, o) && t.call(r, e[o], o, e) === n) return
        };
        x.map = x.collect = function (e, t, n) {
            var r = [];
            return null == e ? r : h && e.map === h ? e.map(t, n) : (T(e, function (e, i, s) {
                r[r.length] = t.call(n, e, i, s)
            }), r)
        };
        var N = "Reduce of empty array with no initial value";
        x.reduce = x.foldl = x.inject = function (e, t, n, r) {
            var i = arguments.length > 2;
            if (null == e && (e = []), p && e.reduce === p) return r && (t = x.bind(t, r)), i ? e.reduce(t, n) : e.reduce(t);
            if (T(e, function (e, s, o) {
                i ? n = t.call(r, n, e, s, o) : (n = e, i = !0)
            }), !i) throw new TypeError(N);
            return n
        }, x.reduceRight = x.foldr = function (e, t, n,
            r) {
            var i = arguments.length > 2;
            if (null == e && (e = []), d && e.reduceRight === d) return r && (t = x.bind(t, r)), i ? e.reduceRight(t, n) : e.reduceRight(t);
            var s = e.length;
            if (s !== +s) {
                var o = x.keys(e);
                s = o.length
            }
            if (T(e, function (u, a, f) {
                a = o ? o[--s] : --s, i ? n = t.call(r, n, e[a], a, f) : (n = e[a], i = !0)
            }), !i) throw new TypeError(N);
            return n
        }, x.find = x.detect = function (e, t, n) {
            var r;
            return C(e, function (e, i, s) {
                return t.call(n, e, i, s) ? (r = e, !0) : void 0
            }), r
        }, x.filter = x.select = function (e, t, n) {
            var r = [];
            return null == e ? r : v && e.filter === v ? e.filter(t, n) : (T(e, function (e, i, s) {
                t.call(n, e, i, s) && (r[r.length] = e)
            }), r)
        }, x.reject = function (e, t, n) {
            return x.filter(e, function (e, r, i) {
                return !t.call(n, e, r, i)
            }, n)
        }, x.every = x.all = function (e, t, r) {
            t || (t = x.identity);
            var i = !0;
            return null == e ? i : m && e.every === m ? e.every(t, r) : (T(e, function (e, s, o) {
                return (i = i && t.call(r, e, s, o)) ? void 0 : n
            }), !! i)
        };
        var C = x.some = x.any = function (e, t, r) {
            t || (t = x.identity);
            var i = !1;
            return null == e ? i : g && e.some === g ? e.some(t, r) : (T(e, function (e, s, o) {
                return i || (i = t.call(r, e, s, o)) ? n : void 0
            }), !! i)
        };
        x.contains = x.include = function (e, t) {
            return null == e ? !1 : y && e.indexOf === y ? -1 != e.indexOf(t) : C(e, function (e) {
                return e === t
            })
        }, x.invoke = function (e, t) {
            var n = u.call(arguments, 2);
            return x.map(e, function (e) {
                return (x.isFunction(t) ? t : e[t]).apply(e, n)
            })
        }, x.pluck = function (e, t) {
            return x.map(e, function (e) {
                return e[t]
            })
        }, x.where = function (e, t) {
            return x.isEmpty(t) ? [] : x.filter(e, function (e) {
                for (var n in t)
                    if (t[n] !== e[n]) return !1;
                return !0
            })
        }, x.max = function (e, t, n) {
            if (!t && x.isArray(e) && e[0] === +e[0] && 65535 > e.length) return Math.max.apply(Math, e);
            if (!t && x.isEmpty(e)) return -1 / 0;
            var r = {
                computed: -1 / 0,
                value: -1 / 0
            };
            return T(e, function (e, i, s) {
                var o = t ? t.call(n, e, i, s) : e;
                o >= r.computed && (r = {
                    value: e,
                    computed: o
                })
            }), r.value
        }, x.min = function (e, t, n) {
            if (!t && x.isArray(e) && e[0] === +e[0] && 65535 > e.length) return Math.min.apply(Math, e);
            if (!t && x.isEmpty(e)) return 1 / 0;
            var r = {
                computed: 1 / 0,
                value: 1 / 0
            };
            return T(e, function (e, i, s) {
                var o = t ? t.call(n, e, i, s) : e;
                r.computed > o && (r = {
                    value: e,
                    computed: o
                })
            }), r.value
        }, x.shuffle = function (e) {
            var t, n = 0,
                r = [];
            return T(e, function (e) {
                t = x.random(n++), r[n - 1] = r[t], r[t] = e
            }), r
        };
        var k = function (e) {
            return x.isFunction(e) ? e : function (t) {
                return t[e]
            }
        };
        x.sortBy = function (e, t, n) {
            var r = k(t);
            return x.pluck(x.map(e, function (e, t, i) {
                return {
                    value: e,
                    index: t,
                    criteria: r.call(n, e, t, i)
                }
            }).sort(function (e, t) {
                var n = e.criteria,
                    r = t.criteria;
                if (n !== r) {
                    if (n > r || void 0 === n) return 1;
                    if (r > n || void 0 === r) return -1
                }
                return e.index < t.index ? -1 : 1
            }), "value")
        };
        var L = function (e, t, n, r) {
            var i = {}, s = k(t || x.identity);
            return T(e, function (t, o) {
                var u = s.call(n, t, o, e);
                r(i, u, t)
            }), i
        };
        x.groupBy = function (e, t, n) {
            return L(e, t, n, function (e, t, n) {
                (x.has(e, t) ? e[t] : e[t] = []).push(n)
            })
        }, x.countBy = function (e, t, n) {
            return L(e, t, n, function (e, t) {
                x.has(e, t) || (e[t] = 0), e[t]++
            })
        }, x.sortedIndex = function (e, t, n, r) {
            n = null == n ? x.identity : k(n);
            for (var i = n.call(r, t), s = 0, o = e.length; o > s;) {
                var u = s + o >>> 1;
                i > n.call(r, e[u]) ? s = u + 1 : o = u
            }
            return s
        }, x.toArray = function (e) {
            return e ? x.isArray(e) ? u.call(e) : e.length === +e.length ? x.map(e, x.identity) : x.values(e) : []
        }, x.size = function (e) {
            return null == e ? 0 : e.length === +e.length ? e.length : x.keys(e).length
        }, x.first = x.head = x.take = function (e, t, n) {
            return null == e ? void 0 : null == t || n ? e[0] : u.call(e, 0, t)
        }, x.initial = function (e, t, n) {
            return u.call(e, 0, e.length - (null == t || n ? 1 : t))
        }, x.last = function (e, t, n) {
            return null == e ? void 0 : null == t || n ? e[e.length - 1] : u.call(e, Math.max(e.length - t, 0))
        }, x.rest = x.tail = x.drop = function (e, t, n) {
            return u.call(e, null == t || n ? 1 : t)
        }, x.compact = function (e) {
            return x.filter(e, x.identity)
        };
        var A = function (e, t, n) {
            return T(e, function (e) {
                x.isArray(e) ? t ? o.apply(n, e) : A(e, t, n) : n.push(e)
            }), n
        };
        x.flatten = function (e, t) {
            return A(e, t, [])
        }, x.without = function (e) {
            return x.difference(e, u.call(arguments, 1))
        }, x.uniq = x.unique = function (e, t, n, r) {
            x.isFunction(t) && (r = n, n = t, t = !1);
            var i = n ? x.map(e, n, r) : e,
                s = [],
                o = [];
            return T(i, function (n, r) {
                (t ? r && o[o.length - 1] === n : x.contains(o, n)) || (o.push(n), s.push(e[r]))
            }), s
        }, x.union = function () {
            return x.uniq(a.apply(r, arguments))
        }, x.intersection = function (e) {
            var t = u.call(arguments, 1);
            return x.filter(x.uniq(e), function (e) {
                return x.every(t, function (t) {
                    return x.indexOf(t, e) >= 0
                })
            })
        }, x.difference = function (e) {
            var t = a.apply(r, u.call(arguments, 1));
            return x.filter(e, function (e) {
                return !x.contains(t, e)
            })
        }, x.zip = function () {
            for (var e = u.call(arguments), t = x.max(x.pluck(e, "length")), n = Array(t), r = 0; t > r; r++) n[r] = x.pluck(e, "" + r);
            return n
        }, x.object = function (e, t) {
            if (null == e) return {};
            for (var n = {}, r = 0, i = e.length; i > r; r++) t ? n[e[r]] = t[r] : n[e[r][0]] = e[r][1];
            return n
        }, x.indexOf = function (e, t, n) {
            if (null == e) return -1;
            var r = 0,
                i = e.length;
            if (n) {
                if ("number" != typeof n) return r = x.sortedIndex(e, t), e[r] === t ? r : -1;
                r = 0 > n ? Math.max(0, i + n) : n
            }
            if (y && e.indexOf === y) return e.indexOf(t, n);
            for (; i > r; r++)
                if (e[r] === t) return r;
            return -1
        }, x.lastIndexOf = function (e, t, n) {
            if (null == e) return -1;
            var r = null != n;
            if (b && e.lastIndexOf === b) return r ? e.lastIndexOf(t, n) : e.lastIndexOf(t);
            for (var i = r ? n : e.length; i--;)
                if (e[i] === t) return i;
            return -1
        }, x.range = function (e, t, n) {
            1 >= arguments.length && (t = e || 0, e = 0), n = arguments[2] || 1;
            for (var r = Math.max(Math.ceil((t - e) / n), 0), i = 0, s = Array(r); r > i;) s[i++] = e, e += n;
            return s
        };
        var O = function () {};
        x.bind = function (e, t) {
            var n, r;
            if (e.bind === S && S) return S.apply(e, u.call(arguments, 1));
            if (!x.isFunction(e)) throw new TypeError;
            return n = u.call(arguments, 2), r = function () {
                if (this instanceof r) {
                    O.prototype = e.prototype;
                    var i = new O;
                    O.prototype = null;
                    var s = e.apply(i, n.concat(u.call(arguments)));
                    return Object(s) === s ? s : i
                }
                return e.apply(t, n.concat(u.call(arguments)))
            }
        }, x.bindAll = function (e) {
            var t = u.call(arguments, 1);
            return 0 == t.length && (t = x.functions(e)), T(t, function (t) {
                e[t] = x.bind(e[t], e)
            }), e
        }, x.memoize = function (e, t) {
            var n = {};
            return t || (t = x.identity),
            function () {
                var r = t.apply(this, arguments);
                return x.has(n, r) ? n[r] : n[r] = e.apply(this, arguments)
            }
        }, x.delay = function (e, t) {
            var n = u.call(arguments, 2);
            return setTimeout(function () {
                return e.apply(null, n)
            }, t)
        }, x.defer = function (e) {
            return x.delay.apply(x, [e, 1].concat(u.call(arguments, 1)))
        }, x.throttle = function (e, t) {
            var n, r, i, s, o = 0,
                u = function () {
                    o = new Date, i = null, s = e.apply(n, r)
                };
            return function () {
                var a = new Date,
                    f = t - (a - o);
                return n = this, r = arguments, 0 >= f ? (clearTimeout(i), i = null, o = a, s = e.apply(n, r)) : i || (i = setTimeout(u, f)), s
            }
        }, x.debounce = function (e, t, n) {
            var r, i;
            return function () {
                var s = this,
                    o = arguments,
                    u = function () {
                        r = null, n || (i = e.apply(s, o))
                    }, a = n && !r;
                return clearTimeout(r), r = setTimeout(u, t), a && (i = e.apply(s, o)), i
            }
        }, x.once = function (e) {
            var t, n = !1;
            return function () {
                return n ? t : (n = !0, t = e.apply(this, arguments), e = null, t)
            }
        }, x.wrap = function (e, t) {
            return function () {
                var n = [e];
                return o.apply(n, arguments), t.apply(this, n)
            }
        }, x.compose = function () {
            var e = arguments;
            return function () {
                for (var t = arguments, n = e.length - 1; n >= 0; n--) t = [e[n].apply(this, t)];
                return t[0]
            }
        }, x.after = function (e, t) {
            return 0 >= e ? t() : function () {
                return 1 > --e ? t.apply(this, arguments) : void 0
            }
        }, x.keys = E || function (e) {
            if (e !== Object(e)) throw new TypeError("Invalid object");
            var t = [];
            for (var n in e) x.has(e, n) && (t[t.length] = n);
            return t
        }, x.values = function (e) {
            var t = [];
            for (var n in e) x.has(e, n) && t.push(e[n]);
            return t
        }, x.pairs = function (e) {
            var t = [];
            for (var n in e) x.has(e, n) && t.push([n, e[n]]);
            return t
        }, x.invert = function (e) {
            var t = {};
            for (var n in e) x.has(e, n) && (t[e[n]] = n);
            return t
        }, x.functions = x.methods = function (e) {
            var t = [];
            for (var n in e) x.isFunction(e[n]) && t.push(n);
            return t.sort()
        }, x.extend = function (e) {
            return T(u.call(arguments, 1), function (t) {
                if (t)
                    for (var n in t) e[n] = t[n]
            }), e
        }, x.pick = function (e) {
            var t = {}, n = a.apply(r, u.call(arguments, 1));
            return T(n, function (n) {
                n in e && (t[n] = e[n])
            }), t
        }, x.omit = function (e) {
            var t = {}, n = a.apply(r, u.call(arguments, 1));
            for (var i in e) x.contains(n, i) || (t[i] = e[i]);
            return t
        }, x.defaults = function (e) {
            return T(u.call(arguments, 1), function (t) {
                if (t)
                    for (var n in t) null == e[n] && (e[n] = t[n])
            }), e
        }, x.clone = function (e) {
            return x.isObject(e) ? x.isArray(e) ? e.slice() : x.extend({}, e) : e
        }, x.tap = function (e, t) {
            return t(e), e
        };
        var M = function (e, t, n, r) {
            if (e === t) return 0 !== e || 1 / e == 1 / t;
            if (null == e || null == t) return e === t;
            e instanceof x && (e = e._wrapped), t instanceof x && (t = t._wrapped);
            var i = f.call(e);
            if (i != f.call(t)) return !1;
            switch (i) {
            case "[object String]":
                return e == t + "";
            case "[object Number]":
                return e != +e ? t != +t : 0 == e ? 1 / e == 1 / t : e == +t;
            case "[object Date]":
            case "[object Boolean]":
                return +e == +t;
            case "[object RegExp]":
                return e.source == t.source && e.global == t.global && e.multiline == t.multiline && e.ignoreCase == t.ignoreCase
            }
            if ("object" != typeof e || "object" != typeof t) return !1;
            for (var s = n.length; s--;)
                if (n[s] == e) return r[s] == t;
            n.push(e), r.push(t);
            var o = 0,
                u = !0;
            if ("[object Array]" == i) {
                if (o = e.length, u = o == t.length)
                    for (; o-- && (u = M(e[o], t[o], n, r)););
            } else {
                var a = e.constructor,
                    l = t.constructor;
                if (a !== l && !(x.isFunction(a) && a instanceof a && x.isFunction(l) && l instanceof l)) return !1;
                for (var c in e)
                    if (x.has(e, c) && (o++, !(u = x.has(t, c) && M(e[c], t[c], n, r)))) break;
                if (u) {
                    for (c in t)
                        if (x.has(t, c) && !(o--)) break;
                    u = !o
                }
            }
            return n.pop(), r.pop(), u
        };
        x.isEqual = function (e, t) {
            return M(e, t, [], [])
        }, x.isEmpty = function (e) {
            if (null == e) return !0;
            if (x.isArray(e) || x.isString(e)) return 0 === e.length;
            for (var t in e)
                if (x.has(e, t)) return !1;
            return !0
        }, x.isElement = function (e) {
            return !!e && 1 === e.nodeType
        }, x.isArray = w || function (e) {
            return "[object Array]" == f.call(e)
        }, x.isObject = function (e) {
            return e === Object(e)
        }, T(["Arguments", "Function", "String", "Number", "Date", "RegExp"], function (e) {
            x["is" + e] = function (t) {
                return f.call(t) == "[object " + e + "]"
            }
        }), x.isArguments(arguments) || (x.isArguments = function (e) {
            return !!e && !! x.has(e, "callee")
        }), x.isFunction = function (e) {
            return "function" == typeof e
        }, x.isFinite = function (e) {
            return isFinite(e) && !isNaN(parseFloat(e))
        }, x.isNaN = function (e) {
            return x.isNumber(e) && e != +e
        }, x.isBoolean = function (e) {
            return e === !0 || e === !1 || "[object Boolean]" == f.call(e)
        }, x.isNull = function (e) {
            return null === e
        }, x.isUndefined = function (e) {
            return void 0 === e
        }, x.has = function (e, t) {
            return l.call(e, t)
        }, x.noConflict = function () {
            return e._ = t, this
        }, x.identity = function (e) {
            return e
        }, x.times = function (e, t, n) {
            for (var r = Array(e), i = 0; e > i; i++) r[i] = t.call(n, i);
            return r
        }, x.random = function (e, t) {
            return null == t && (t = e, e = 0), e + (0 | Math.random() * (t - e + 1))
        };
        var _ = {
            escape: {
                "&": "&amp;",
                "<": "&lt;",
                ">": "&gt;",
                '"': "&quot;",
                "'": "&#x27;",
                "/": "&#x2F;"
            }
        };
        _.unescape = x.invert(_.escape);
        var D = {
            escape: RegExp("[" + x.keys(_.escape).join("") + "]", "g"),
            unescape: RegExp("(" + x.keys(_.unescape).join("|") + ")", "g")
        };
        x.each(["escape", "unescape"], function (e) {
            x[e] = function (t) {
                return null == t ? "" : ("" + t).replace(D[e], function (t) {
                    return _[e][t]
                })
            }
        }), x.result = function (e, t) {
            if (null == e) return null;
            var n = e[t];
            return x.isFunction(n) ? n.call(e) : n
        }, x.mixin = function (e) {
            T(x.functions(e), function (t) {
                var n = x[t] = e[t];
                x.prototype[t] = function () {
                    var e = [this._wrapped];
                    return o.apply(e, arguments), F.call(this, n.apply(x, e))
                }
            })
        };
        var P = 0;
        x.uniqueId = function (e) {
            var t = "" + ++P;
            return e ? e + t : t
        }, x.templateSettings = {
            evaluate: /<%([\s\S]+?)%>/g,
            interpolate: /<%=([\s\S]+?)%>/g,
            escape: /<%-([\s\S]+?)%>/g
        };
        var H = /(.)^/,
            B = {
                "'": "'",
                "\\": "\\",
                "\r": "r",
                "\n": "n",
                "	": "t",
                "\u2028": "u2028",
                "\u2029": "u2029"
            }, j = /\\|'|\r|\n|\t|\u2028|\u2029/g;
        x.template = function (e, t, n) {
            n = x.defaults({}, n, x.templateSettings);
            var r = RegExp([(n.escape || H).source, (n.interpolate || H).source, (n.evaluate || H).source].join("|") + "|$", "g"),
                i = 0,
                s = "__p+='";
            e.replace(r, function (t, n, r, o, u) {
                return s += e.slice(i, u).replace(j, function (e) {
                    return "\\" + B[e]
                }), n && (s += "'+\n((__t=(" + n + "))==null?'':_.escape(__t))+\n'"), r && (s += "'+\n((__t=(" + r + "))==null?'':__t)+\n'"), o && (s += "';\n" + o + "\n__p+='"), i = u + t.length, t
            }), s += "';\n", n.variable || (s = "with(obj||{}){\n" + s + "}\n"), s = "var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n" + s + "return __p;\n";
            try {
                var o = Function(n.variable || "obj", "_", s)
            } catch (u) {
                throw u.source = s, u
            }
            if (t) return o(t, x);
            var a = function (e) {
                return o.call(this, e, x)
            };
            return a.source = "function(" + (n.variable || "obj") + "){\n" + s + "}", a
        }, x.chain = function (e) {
            return x(e).chain()
        };
        var F = function (e) {
            return this._chain ? x(e).chain() : e
        };
        x.mixin(x), T(["pop", "push", "reverse", "shift", "sort", "splice", "unshift"], function (e) {
            var t = r[e];
            x.prototype[e] = function () {
                var n = this._wrapped;
                return t.apply(n, arguments), "shift" != e && "splice" != e || 0 !== n.length || delete n[0], F.call(this, n)
            }
        }), T(["concat", "join", "slice"], function (e) {
            var t = r[e];
            x.prototype[e] = function () {
                return F.call(this, t.apply(this._wrapped, arguments))
            }
        }), x.extend(x.prototype, {
            chain: function () {
                return this._chain = !0, this
            },
            value: function () {
                return this._wrapped
            }
        })
    }).call(this), r = {
        getInsertionPoint: i,
        colorClass: s
    };
    var o = this,
        u = .25,
        n = {
            ordinal: f,
            linear: l,
            exponential: c,
            time: h,
            xy: v
        };
    (function () {
        function s(e, t, n, r) {
            e.xScale2 = d3.scale.ordinal().domain(d3.range(0, n.length)).rangeRoundBands([0, e.xScale.rangeBand()], .08)
        }

        function o(t, s, o, u, a) {
            var f, l, c = t.yZero;
            f = t._g.selectAll(n + o).data(u, function (e) {
                return e.className
            }), f.enter().insert("g", i).attr("data-index", e).style("opacity", 0).attr("class", function (e, t) {
                var n = _.uniq((o + e.className).split(".")).join(" ");
                return n + " bar " + r.colorClass(this, t)
            }).attr("transform", function (e, n) {
                return "translate(" + t.xScale2(n) + ",0)"
            }), l = f.selectAll("rect").data(function (e) {
                return e.data
            }, function (e) {
                return e.x
            }), l.enter().append("rect").attr("width", 0).attr("rx", 3).attr("ry", 3).attr("x", function (e) {
                return t.xScale(e.x) + t.xScale2.rangeBand() / 2
            }).attr("height", function (e) {
                return Math.abs(c - t.yScale(e.y))
            }).attr("y", function (e) {
                return e.y < 0 ? c : t.yScale(e.y)
            }).on("mouseover", a.mouseover).on("mouseout", a.mouseout).on("click", a.click), s.barGroups = f, s.bars = l
        }

        function u(e, t, n) {
            var i = e.yZero;
            t.barGroups.attr("class", function (e, t) {
                return r.colorClass(this, t)
            }).transition().duration(n).style("opacity", 1).attr("transform", function (t, n) {
                return "translate(" + e.xScale2(n) + ",0)"
            }), t.bars.transition().duration(n).attr("width", e.xScale2.rangeBand()).attr("x", function (t) {
                return e.xScale(t.x)
            }).attr("height", function (t) {
                return Math.abs(i - e.yScale(t.y))
            }).attr("y", function (t) {
                return t.y < 0 ? i : e.yScale(t.y)
            })
        }

        function a(e, t, n) {
            t.bars.exit().transition().duration(n).attr("width", 0).remove(), t.barGroups.exit().transition().duration(n).style("opacity", 0).remove()
        }

        function f(e, t, n) {
            var r = e.xScale2 ? e.xScale2.rangeBand() / 2 : 0;
            delete e.xScale2, t.bars.transition().duration(n).attr("width", 0).attr("x", function (t) {
                return e.xScale(t.x) + r
            })
        }
        var e = 2,
            n = "g.bar",
            i = r.getInsertionPoint(e);
        t.bar = {
            postUpdateScale: s,
            enter: o,
            update: u,
            exit: a,
            destroy: f
        }
    })(),
    function () {
        function s(t, s, o, u, a) {
            function g(e) {
                return [e.data]
            }
            var f = t._options.interpolation,
                l = function (e, n) {
                    return !t.xScale2 && !t.xScale.rangeBand ? t.xScale(e.x) : t.xScale(e.x) + t.xScale.rangeBand() / 2
                }, c = function (e) {
                    return t.yScale(e.y)
                }, h = d3.svg.line().x(l).interpolate(f),
                p = d3.svg.area().x(l).y1(t.yZero).interpolate(f),
                d, v, m;
            d = t._g.selectAll(n + o).data(u, function (e) {
                return e.className
            }), d.enter().insert("g", i).attr("data-index", e).attr("class", function (e, t) {
                var n = _.uniq((o + e.className).split(".")).join(" ");
                return n + " line " + r.colorClass(this, t)
            }), v = d.selectAll("path.fill").data(g), v.enter().append("path").attr("class", "fill").style("opacity", 0).attr("d", p.y0(c)), m = d.selectAll("path.line").data(g), m.enter().append("path").attr("class", "line").style("opacity", 0).attr("d", h.y(c)), s.lineContainers = d, s.lineFills = v, s.linePaths = m, s.lineX = l, s.lineY = c, s.lineA = p, s.line = h
        }

        function o(e, t, n) {
            t.lineContainers.attr("class", function (e, t) {
                return r.colorClass(this, t)
            }), t.lineFills.transition().duration(n).style("opacity", 1).attr("d", t.lineA.y0(t.lineY)), t.linePaths.transition().duration(n).style("opacity", 1).attr("d", t.line.y(t.lineY))
        }

        function u(e, t) {
            t.linePaths.exit().style("opacity", 0).remove(), t.lineFills.exit().style("opacity", 0).remove(), t.lineContainers.exit().remove()
        }

        function a(e, t, n) {
            t.linePaths.transition().duration(n).style("opacity", 0), t.lineFills.transition().duration(n).style("opacity", 0)
        }
        var e = 3,
            n = "g.line",
            i = r.getInsertionPoint(e);
        t.line = {
            enter: s,
            update: o,
            exit: u,
            destroy: a
        }
    }(),
    function () {
        function n(t, n, r, i, s) {
            var o;
            e.enter(t, n, r, i, s), o = n.lineContainers.selectAll("circle").data(function (e) {
                return e.data
            }, function (e) {
                return e.x
            }), o.enter().append("circle").style("opacity", 0).attr("cx", n.lineX).attr("cy", n.lineY).attr("r", 5).on("mouseover", s.mouseover).on("mouseout", s.mouseout).on("click", s.click), n.lineCircles = o
        }

        function r(t, n, r) {
            e.update.apply(null, _.toArray(arguments)), n.lineCircles.transition().duration(r).style("opacity", 1).attr("cx", n.lineX).attr("cy", n.lineY)
        }

        function i(t, n) {
            n.lineCircles.exit().remove(), e.exit.apply(null, _.toArray(arguments))
        }

        function s(t, n, r) {
            e.destroy.apply(null, _.toArray(arguments));
            if (!n.lineCircles) return;
            n.lineCircles.transition().duration(r).style("opacity", 0)
        }
        var e = t.line;
        t["line-dotted"] = {
            enter: n,
            update: r,
            exit: i,
            destroy: s
        }
    }(),
    function () {
        function n(t, n, r, i, s) {
            e.enter(t, n, r, i, s)
        }

        function r(e) {
            function t(e, t) {
                return e + t.y
            }
            var n = _.map(e, function (e) {
                var n = e.data.length,
                    r = _.clone(e.data);
                e = _.clone(e);
                while (n) n -= 1, r[n] = _.clone(e.data[n]), r[n].y0 = e.data[n].y, r[n].y = _.reduce(_.first(e.data, n), t, e.data[n].y);
                return _.extend(e, {
                    data: r
                })
            });
            return n
        }

        function i(e) {
            if (!e.hasOwnProperty("cumulativeOMainData")) return;
            e._mainData = e.cumulativeOMainData, delete e.cumulativeOMainData, e._compData = e.cumulativeOCompData, delete e.cumulativeOCompData
        }

        function s(e, t) {
            i(e), e.cumulativeOMainData = e._mainData, e._mainData = r(e._mainData), e.cumulativeOCompData = e._compData, e._compData = r(e._compData)
        }

        function o(t, n, r) {
            i(t), e.destroy.apply(null, _.toArray(arguments))
        }
        var e = t["line-dotted"];
        t.cumulative = {
            preUpdateScale: s,
            enter: n,
            update: e.update,
            exit: e.exit,
            destroy: o
        }
    }();
    var m = [
        []
    ],
        g = {
            mouseover: function (e, t) {},
            mouseout: function (e, t) {},
            click: function (e, t) {},
            axisPaddingTop: 0,
            axisPaddingRight: 0,
            axisPaddingBottom: 5,
            axisPaddingLeft: 20,
            paddingTop: 0,
            paddingRight: 0,
            paddingBottom: 20,
            paddingLeft: 60,
            tickHintX: 10,
            tickFormatX: function (e) {
                return e
            },
            tickHintY: 10,
            tickFormatY: function (e) {
                return e
            },
            xMin: null,
            xMax: null,
            yMin: null,
            yMax: null,
            dataFormatX: function (e) {
                return e
            },
            dataFormatY: function (e) {
                return e
            },
            unsupported: function (e) {
                d3.select(e).text("SVG is not supported on your browser")
            },
            empty: function (e, t, n) {},
            notempty: function (e, t) {},
            timing: 750,
            interpolation: "monotone"
        };
    e.setVis = function (e, n) {
        if (t.hasOwnProperty(e)) throw 'Cannot override vis type "' + e + '".';
        t[e] = n
    }, e.getVis = function (e) {
        if (!t.hasOwnProperty(e)) throw 'Vis type "' + e + '" does not exist.';
        return _.clone(t[e])
    }, e.visutils = r, e.scales = n, _.defaults(e.prototype, {
        setType: function (e, n) {
            var r = this;
            if (r._type && e === r._type) return;
            if (!t.hasOwnProperty(e)) throw 'Vis type "' + e + '" is not defined.';
            r._type && r._destroy(r._vis, r._mainStorage), r._type = e, r._vis = t[e], n || r._draw()
        },
        setData: function (e) {
            function i(e) {
                var t = _.map(_.clone(e.data), function (e) {
                    var t = _.clone(e);
                    return e.hasOwnProperty("x") && (t.x = n.dataFormatX(e.x)), e.hasOwnProperty("y") && (t.y = n.dataFormatY(e.y)), t
                }).sort(function (e, t) {
                    return !e.x && !t.x ? 0 : e.x < t.x ? -1 : 1
                });
                return _.extend(_.clone(e), {
                    data: t
                })
            }
            var t = this,
                n = t._options,
                r = _.clone(e);
            if (!e.hasOwnProperty("main")) throw 'No "main" key found in given chart data.';
            switch (e.type) {
            case "bar":
                e.xScale = "ordinal";
                break;
            case undefined:
                e.type = t._type
            }
            n.xMin = e.xMin || n.xMin, n.xMax = e.xMax || n.xMax, n.yMin = e.yMin || n.yMin, n.yMax = e.yMax || n.yMax, t._vis && t._destroy(t._vis, t._mainStorage), t.setType(e.type, !0), r.main = _.map(r.main, i), t._mainData = r.main, t._xScaleType = r.xScale, t._yScaleType = r.yScale, r.hasOwnProperty("comp") ? (r.comp = _.map(r.comp, i), t._compData = r.comp) : t._compData = [], t._draw()
        },
        setScale: function (e, t) {
            var n = this;
            switch (e) {
            case "x":
                n._xScaleType = t;
                break;
            case "y":
                n._yScaleType = t;
                break;
            default:
                throw 'Cannot change scale of unknown axis "' + e + '".'
            }
            n._draw()
        },
        _drawSvg: function () {
            var e = this,
                t = e._container,
                n = e._options,
                r = parseInt(t.style("width").replace("px", ""), 10),
                i = parseInt(t.style("height").replace("px", ""), 10),
                s, o, u;
            s = t.selectAll("svg").data(m), s.enter().append("svg").attr("height", i).attr("width", r).attr("class", "xchart"), s.transition().attr("width", r).attr("height", i), o = s.selectAll("g").data(m), o.enter().append("g").attr("transform", "translate(" + n.paddingLeft + "," + n.paddingTop + ")"), u = o.selectAll("g.scale").data(m), u.enter().append("g").attr("class", "scale"), e._svg = s, e._g = o, e._gScale = u, e._height = i - n.paddingTop - n.paddingBottom - n.axisPaddingTop - n.axisPaddingBottom, e._width = r - n.paddingLeft - n.paddingRight - n.axisPaddingLeft - n.axisPaddingRight
        },
        _resize: function (e) {
            var t = this;
            t._drawSvg(), t._draw()
        },
        _drawAxes: function () {
            if (this._noData) return;
            var e = this,
                t = e._options,
                n = e._gScale.transition().duration(t.timing),
                r = t.tickHintX,
                i = t.tickHintY,
                s = e._height + t.axisPaddingTop + t.axisPaddingBottom,
                o = d3.svg.line().x(function (e) {
                    return e
                }),
                u, a, f, l, c, h, p;
            l = d3.svg.axis().scale(e.xScale).ticks(r).tickSize(-e._height).tickFormat(t.tickFormatX).orient("bottom"), f = e._gScale.selectAll("g.axisX").data(m), f.enter().append("g").attr("class", "axis axisX").attr("transform", "translate(0," + s + ")"), f.call(l), p = e._gScale.selectAll(".axisX g")[0], p.length > e._width / 80 && (p.sort(function (e, t) {
                var n = /translate\(([^,)]+)/;
                return e = e.getAttribute("transform").match(n), t = t.getAttribute("transform").match(n), parseFloat(e[1], 10) - parseFloat(t[1], 10)
            }), d3.selectAll(p).filter(function (e, t) {
                return t % (Math.ceil(p.length / r) + 1)
            }).remove()), h = d3.svg.axis().scale(e.yScale).ticks(i).tickSize(-e._width - t.axisPaddingRight - t.axisPaddingLeft).tickFormat(t.tickFormatY).orient("left"), c = e._gScale.selectAll("g.axisY").data(m), c.enter().append("g").attr("class", "axis axisY").attr("transform", "translate(0,0)"), n.selectAll("g.axisY").call(h), u = e._gScale.selectAll("g.axisZero").data([
                []
            ]), u.enter().append("g").attr("class", "axisZero"), a = u.selectAll("line").data([
                []
            ]), a.enter().append("line").attr("x1", 0).attr("x2", e._width + t.axisPaddingLeft + t.axisPaddingRight).attr("y1", e.yZero).attr("y2", e.yZero), a.transition().duration(t.timing).attr("y1", e.yZero).attr("y2", e.yZero)
        },
        _updateScale: function () {
            var e = this,
                t = function () {
                    return _.union(e._mainData, e._compData)
                }, r = t(),
                i = e._vis,
                s, o;
            delete e.xScale, delete e.yScale, delete e.yZero, i.hasOwnProperty("preUpdateScale") && i.preUpdateScale(e, r, e._mainData, e._compData), r = t(), s = n.xy(e, r, e._xScaleType, e._yScaleType), e.xScale = s.x, e.yScale = s.y, o = e.yScale.domain()[0], e.yZero = o > 0 ? e.yScale(o) : e.yScale(0), i.hasOwnProperty("postUpdateScale") && i.postUpdateScale(e, r, e._mainData, e._compData)
        },
        _enter: function (e, t, n, r) {
            var i = this,
                s = {
                    click: i._options.click,
                    mouseover: i._options.mouseover,
                    mouseout: i._options.mouseout
                };
            i._checkVisMethod(e, "enter"), e.enter(i, t, r, n, s)
        },
        _update: function (e, t) {
            var n = this;
            n._checkVisMethod(e, "update"), e.update(n, t, n._options.timing)
        },
        _exit: function (e, t) {
            var n = this;
            n._checkVisMethod(e, "exit"), e.exit(n, t, n._options.timing)
        },
        _destroy: function (e, t) {
            var n = this;
            n._checkVisMethod(e, "destroy");
            try {
                e.destroy(n, t, n._options.timing)
            } catch (r) {}
        },
        _mainStorage: {},
        _compStorage: {},
        _draw: function () {
            var e = this,
                n = e._options,
                r, i;
            e._noData = _.flatten(_.pluck(e._mainData, "data").concat(_.pluck(e._compData, "data"))).length === 0, e._updateScale(), e._drawAxes(), e._enter(e._vis, e._mainStorage, e._mainData, ".main"), e._exit(e._vis, e._mainStorage), e._update(e._vis, e._mainStorage), r = _.chain(e._compData).groupBy(function (e) {
                return e.type
            }), i = r.keys(), _.each(e._compStorage, function (n, r) {
                if (-1 === i.indexOf(r).value()) {
                    var s = t[r];
                    e._enter(s, n, [], ".comp." + r.replace(/\W+/g, "")), e._exit(s, n)
                }
            }), r.each(function (n, r) {
                var i = t[r],
                    s;
                e._compStorage.hasOwnProperty(r) || (e._compStorage[r] = {}), s = e._compStorage[r], e._enter(i, s, n, ".comp." + r.replace(/\W+/g, "")), e._exit(i, s), e._update(i, s)
            }), e._noData ? n.empty(e, e._selector, e._mainData) : n.notempty(e, e._selector)
        },
        _checkVisMethod: function (e, t) {
            var n = this;
            if (!e[t]) throw 'Required method "' + t + '" not found on vis type "' + n._type + '".'
        }
    });
    if (typeof define == "function" && define.amd && typeof define.amd == "object") {
        define(function () {
            return e
        });
        return
    }
    window.xChart = e
}();
var wysihtml5 = {
    version: "0.3.0",
    commands: {},
    dom: {},
    quirks: {},
    toolbar: {},
    lang: {},
    selection: {},
    views: {},
    INVISIBLE_SPACE: "﻿",
    EMPTY_FUNCTION: function () {},
    ELEMENT_NODE: 1,
    TEXT_NODE: 3,
    BACKSPACE_KEY: 8,
    ENTER_KEY: 13,
    ESCAPE_KEY: 27,
    SPACE_KEY: 32,
    DELETE_KEY: 46
};
window.rangy = function () {
    function u(n, r) {
        var i = typeof n[r];
        return i == t || i == e && !! n[r] || i == "unknown"
    }

    function a(t, n) {
        return typeof t[n] == e && !! t[n]
    }

    function f(e, t) {
        return typeof e[t] != n
    }

    function l(e) {
        return function (t, n) {
            var r = n.length;
            while (r--)
                if (!e(t, n[r])) return !1;
            return !0
        }
    }

    function d(e) {
        return e && c(e, o) && p(e, s)
    }

    function m(e) {
        window.alert("Rangy not supported in your browser. Reason: " + e), v.initialized = !0, v.supported = !1
    }

    function g(e) {
        var t = "Rangy warning: " + e;
        v.config.alertOnWarn ? window.alert(t) : typeof window.console != n && typeof window.console.log != n && window.console.log(t)
    }

    function w() {
        if (v.initialized) return;
        var e, t = !1,
            n = !1;
        u(document, "createRange") && (e = document.createRange(), c(e, i) && p(e, r) && (t = !0), e.detach());
        var s = a(document, "body") ? document.body : document.getElementsByTagName("body")[0];
        s && u(s, "createTextRange") && (e = s.createTextRange(), d(e) && (n = !0)), !t && !n && m("Neither Range nor TextRange are implemented"), v.initialized = !0, v.features = {
            implementsDomRange: t,
            implementsTextRange: n
        };
        var o = b.concat(y);
        for (var f = 0, l = o.length; f < l; ++f) try {
            o[f](v)
        } catch (h) {
            a(window, "console") && u(window.console, "log") && window.console.log("Init listener threw an exception. Continuing.", h)
        }
    }

    function S(e) {
        e = e || window, w();
        for (var t = 0, n = E.length; t < n; ++t) E[t](e)
    }

    function x(e) {
        this.name = e, this.initialized = !1, this.supported = !1
    }
    var e = "object",
        t = "function",
        n = "undefined",
        r = ["startContainer", "startOffset", "endContainer", "endOffset", "collapsed", "commonAncestorContainer", "START_TO_START", "START_TO_END", "END_TO_START", "END_TO_END"],
        i = ["setStart", "setStartBefore", "setStartAfter", "setEnd", "setEndBefore", "setEndAfter", "collapse", "selectNode", "selectNodeContents", "compareBoundaryPoints", "deleteContents", "extractContents", "cloneContents", "insertNode", "surroundContents", "cloneRange", "toString", "detach"],
        s = ["boundingHeight", "boundingLeft", "boundingTop", "boundingWidth", "htmlText", "text"],
        o = ["collapse", "compareEndPoints", "duplicate", "getBookmark", "moveToBookmark", "moveToElementText", "parentElement", "pasteHTML", "select", "setEndPoint", "getBoundingClientRect"],
        c = l(u),
        h = l(a),
        p = l(f),
        v = {
            version: "1.2.2",
            initialized: !1,
            supported: !0,
            util: {
                isHostMethod: u,
                isHostObject: a,
                isHostProperty: f,
                areHostMethods: c,
                areHostObjects: h,
                areHostProperties: p,
                isTextRange: d
            },
            features: {},
            modules: {},
            config: {
                alertOnWarn: !1,
                preferTextRange: !1
            }
        };
    v.fail = m, v.warn = g, {}.hasOwnProperty ? v.util.extend = function (e, t) {
        for (var n in t) t.hasOwnProperty(n) && (e[n] = t[n])
    } : m("hasOwnProperty not supported");
    var y = [],
        b = [];
    v.init = w, v.addInitListener = function (e) {
        v.initialized ? e(v) : y.push(e)
    };
    var E = [];
    v.addCreateMissingNativeApiListener = function (e) {
        E.push(e)
    }, v.createMissingNativeApi = S, x.prototype.fail = function (e) {
        throw this.initialized = !0, this.supported = !1, new Error("Module '" + this.name + "' failed to load: " + e)
    }, x.prototype.warn = function (e) {
        v.warn("Module " + this.name + ": " + e)
    }, x.prototype.createError = function (e) {
        return new Error("Error in Rangy " + this.name + " module: " + e)
    }, v.createModule = function (e, t) {
        var n = new x(e);
        v.modules[e] = n, b.push(function (e) {
            t(e, n), n.initialized = !0, n.supported = !0
        })
    }, v.requireModules = function (e) {
        for (var t = 0, n = e.length, r, i; t < n; ++t) {
            i = e[t], r = v.modules[i];
            if (!r || !(r instanceof x)) throw new Error("Module '" + i + "' not found");
            if (!r.supported) throw new Error("Module '" + i + "' not supported")
        }
    };
    var T = !1,
        N = function (e) {
            T || (T = !0, v.initialized || w())
        };
    if (typeof window == n) {
        m("No window found");
        return
    }
    if (typeof document == n) {
        m("No document found");
        return
    }
    return u(document, "addEventListener") && document.addEventListener("DOMContentLoaded", N, !1), u(window, "addEventListener") ? window.addEventListener("load", N, !1) : u(window, "attachEvent") ? window.attachEvent("onload", N) : m("Window does not have required addEventListener or attachEvent method"), v
}(), rangy.createModule("DomUtil", function (e, t) {
    function u(e) {
        var t;
        return typeof e.namespaceURI == n || (t = e.namespaceURI) === null || t == "http://www.w3.org/1999/xhtml"
    }

    function a(e) {
        var t = e.parentNode;
        return t.nodeType == 1 ? t : null
    }

    function f(e) {
        var t = 0;
        while (e = e.previousSibling) t++;
        return t
    }

    function l(e) {
        var t;
        return d(e) ? e.length : (t = e.childNodes) ? t.length : 0
    }

    function c(e, t) {
        var n = [],
            r;
        for (r = e; r; r = r.parentNode) n.push(r);
        for (r = t; r; r = r.parentNode)
            if (o(n, r)) return r;
        return null
    }

    function h(e, t, n) {
        var r = n ? t : t.parentNode;
        while (r) {
            if (r === e) return !0;
            r = r.parentNode
        }
        return !1
    }

    function p(e, t, n) {
        var r, i = n ? e : e.parentNode;
        while (i) {
            r = i.parentNode;
            if (r === t) return i;
            i = r
        }
        return null
    }

    function d(e) {
        var t = e.nodeType;
        return t == 3 || t == 4 || t == 8
    }

    function v(e, t) {
        var n = t.nextSibling,
            r = t.parentNode;
        return n ? r.insertBefore(e, n) : r.appendChild(e), e
    }

    function m(e, t) {
        var n = e.cloneNode(!1);
        return n.deleteData(0, t), e.deleteData(t, e.length - t), v(n, e), n
    }

    function g(e) {
        if (e.nodeType == 9) return e;
        if (typeof e.ownerDocument != n) return e.ownerDocument;
        if (typeof e.document != n) return e.document;
        if (e.parentNode) return g(e.parentNode);
        throw new Error("getDocument: no document found for node")
    }

    function y(e) {
        var t = g(e);
        if (typeof t.defaultView != n) return t.defaultView;
        if (typeof t.parentWindow != n) return t.parentWindow;
        throw new Error("Cannot get a window object for node")
    }

    function b(e) {
        if (typeof e.contentDocument != n) return e.contentDocument;
        if (typeof e.contentWindow != n) return e.contentWindow.document;
        throw new Error("getIframeWindow: No Document object found for iframe element")
    }

    function w(e) {
        if (typeof e.contentWindow != n) return e.contentWindow;
        if (typeof e.contentDocument != n) return e.contentDocument.defaultView;
        throw new Error("getIframeWindow: No Window object found for iframe element")
    }

    function E(e) {
        return r.isHostObject(e, "body") ? e.body : e.getElementsByTagName("body")[0]
    }

    function S(e) {
        var t;
        while (t = e.parentNode) e = t;
        return e
    }

    function x(e, t, n, r) {
        var i, s, o, u, a;
        if (e == n) return t === r ? 0 : t < r ? -1 : 1;
        if (i = p(n, e, !0)) return t <= f(i) ? -1 : 1;
        if (i = p(e, n, !0)) return f(i) < r ? -1 : 1;
        s = c(e, n), o = e === s ? s : p(e, s, !0), u = n === s ? s : p(n, s, !0);
        if (o === u) throw new Error("comparePoints got to case 4 and childA and childB are the same!");
        a = s.firstChild;
        while (a) {
            if (a === o) return -1;
            if (a === u) return 1;
            a = a.nextSibling
        }
        throw new Error("Should not be here!")
    }

    function T(e) {
        var t = g(e).createDocumentFragment(),
            n;
        while (n = e.firstChild) t.appendChild(n);
        return t
    }

    function N(e) {
        if (!e) return "[No node]";
        if (d(e)) return '"' + e.data + '"';
        if (e.nodeType == 1) {
            var t = e.id ? ' id="' + e.id + '"' : "";
            return "<" + e.nodeName + t + ">[" + e.childNodes.length + "]"
        }
        return e.nodeName
    }

    function C(e) {
        this.root = e, this._next = e
    }

    function k(e) {
        return new C(e)
    }

    function L(e, t) {
        this.node = e, this.offset = t
    }

    function A(e) {
        this.code = this[e], this.codeName = e, this.message = "DOMException: " + this.codeName
    }
    var n = "undefined",
        r = e.util;
    r.areHostMethods(document, ["createDocumentFragment", "createElement", "createTextNode"]) || t.fail("document missing a Node creation method"), r.isHostMethod(document, "getElementsByTagName") || t.fail("document missing getElementsByTagName method");
    var i = document.createElement("div");
    r.areHostMethods(i, ["insertBefore", "appendChild", "cloneNode"] || !r.areHostObjects(i, ["previousSibling", "nextSibling", "childNodes", "parentNode"])) || t.fail("Incomplete Element implementation"), r.isHostProperty(i, "innerHTML") || t.fail("Element is missing innerHTML property");
    var s = document.createTextNode("test");
    r.areHostMethods(s, ["splitText", "deleteData", "insertData", "appendData", "cloneNode"] || !r.areHostObjects(i, ["previousSibling", "nextSibling", "childNodes", "parentNode"]) || !r.areHostProperties(s, ["data"])) || t.fail("Incomplete Text Node implementation");
    var o = function (e, t) {
        var n = e.length;
        while (n--)
            if (e[n] === t) return !0;
        return !1
    };
    C.prototype = {
        _current: null,
        hasNext: function () {
            return !!this._next
        },
        next: function () {
            var e = this._current = this._next,
                t, n;
            if (this._current) {
                t = e.firstChild;
                if (t) this._next = t;
                else {
                    n = null;
                    while (e !== this.root && !(n = e.nextSibling)) e = e.parentNode;
                    this._next = n
                }
            }
            return this._current
        },
        detach: function () {
            this._current = this._next = this.root = null
        }
    }, L.prototype = {
        equals: function (e) {
            return this.node === e.node & this.offset == e.offset
        },
        inspect: function () {
            return "[DomPosition(" + N(this.node) + ":" + this.offset + ")]"
        }
    }, A.prototype = {
        INDEX_SIZE_ERR: 1,
        HIERARCHY_REQUEST_ERR: 3,
        WRONG_DOCUMENT_ERR: 4,
        NO_MODIFICATION_ALLOWED_ERR: 7,
        NOT_FOUND_ERR: 8,
        NOT_SUPPORTED_ERR: 9,
        INVALID_STATE_ERR: 11
    }, A.prototype.toString = function () {
        return this.message
    }, e.dom = {
        arrayContains: o,
        isHtmlNamespace: u,
        parentElement: a,
        getNodeIndex: f,
        getNodeLength: l,
        getCommonAncestor: c,
        isAncestorOf: h,
        getClosestAncestorIn: p,
        isCharacterDataNode: d,
        insertAfter: v,
        splitDataNode: m,
        getDocument: g,
        getWindow: y,
        getIframeWindow: w,
        getIframeDocument: b,
        getBody: E,
        getRootContainer: S,
        comparePoints: x,
        inspectNode: N,
        fragmentFromNodeChildren: T,
        createIterator: k,
        DomPosition: L
    }, e.DOMException = A
}), rangy.createModule("DomRange", function (e, t) {
    function s(e, t) {
        return e.nodeType != 3 && (n.isAncestorOf(e, t.startContainer, !0) || n.isAncestorOf(e, t.endContainer, !0))
    }

    function o(e) {
        return n.getDocument(e.startContainer)
    }

    function u(e, t, n) {
        var r = e._listeners[t];
        if (r)
            for (var i = 0, s = r.length; i < s; ++i) r[i].call(e, {
                target: e,
                args: n
            })
    }

    function a(e) {
        return new r(e.parentNode, n.getNodeIndex(e))
    }

    function f(e) {
        return new r(e.parentNode, n.getNodeIndex(e) + 1)
    }

    function l(e, t, r) {
        var i = e.nodeType == 11 ? e.firstChild : e;
        return n.isCharacterDataNode(t) ? r == t.length ? n.insertAfter(e, t) : t.parentNode.insertBefore(e, r == 0 ? t : n.splitDataNode(t, r)) : r >= t.childNodes.length ? t.
        appendChild(e) : t.insertBefore(e, t.childNodes[r]), i
    }

    function c(e) {
        var t;
        for (var n, r = o(e.range).createDocumentFragment(), s; n = e.next();) {
            t = e.isPartiallySelectedSubtree(), n = n.cloneNode(!t), t && (s = e.getSubtreeIterator(), n.appendChild(c(s)), s.detach(!0));
            if (n.nodeType == 10) throw new i("HIERARCHY_REQUEST_ERR");
            r.appendChild(n)
        }
        return r
    }

    function h(e, t, r) {
        var i, s;
        r = r || {
            stop: !1
        };
        for (var o, u; o = e.next();)
            if (e.isPartiallySelectedSubtree()) {
                if (t(o) === !1) {
                    r.stop = !0;
                    return
                }
                u = e.getSubtreeIterator(), h(u, t, r), u.detach(!0);
                if (r.stop) return
            } else {
                i = n.createIterator(o);
                while (s = i.next())
                    if (t(s) === !1) {
                        r.stop = !0;
                        return
                    }
            }
    }

    function p(e) {
        var t;
        while (e.next()) e.isPartiallySelectedSubtree() ? (t = e.getSubtreeIterator(), p(t), t.detach(!0)) : e.remove()
    }

    function d(e) {
        for (var t, n = o(e.range).createDocumentFragment(), r; t = e.next();) {
            e.isPartiallySelectedSubtree() ? (t = t.cloneNode(!1), r = e.getSubtreeIterator(), t.appendChild(d(r)), r.detach(!0)) : e.remove();
            if (t.nodeType == 10) throw new i("HIERARCHY_REQUEST_ERR");
            n.appendChild(t)
        }
        return n
    }

    function v(e, t, n) {
        var r = !! t && !! t.length,
            i, s = !! n;
        r && (i = new RegExp("^(" + t.join("|") + ")$"));
        var o = [];
        return h(new g(e, !1), function (e) {
            (!r || i.test(e.nodeType)) && (!s || n(e)) && o.push(e)
        }), o
    }

    function m(e) {
        var t = typeof e.getName == "undefined" ? "Range" : e.getName();
        return "[" + t + "(" + n.inspectNode(e.startContainer) + ":" + e.startOffset + ", " + n.inspectNode(e.endContainer) + ":" + e.endOffset + ")]"
    }

    function g(e, t) {
        this.range = e, this.clonePartiallySelectedTextNodes = t;
        if (!e.collapsed) {
            this.sc = e.startContainer, this.so = e.startOffset, this.ec = e.endContainer, this.eo = e.endOffset;
            var r = e.commonAncestorContainer;
            this.sc === this.ec && n.isCharacterDataNode(this.sc) ? (this.isSingleCharacterDataNode = !0, this._first = this._last = this._next = this.sc) : (this._first = this._next = this.sc === r && !n.isCharacterDataNode(this.sc) ? this.sc.childNodes[this.so] : n.getClosestAncestorIn(this.sc, r, !0), this._last = this.ec === r && !n.isCharacterDataNode(this.ec) ? this.ec.childNodes[this.eo - 1] : n.getClosestAncestorIn(this.ec, r, !0))
        }
    }

    function y(e) {
        this.code = this[e], this.codeName = e, this.message = "RangeException: " + this.codeName
    }

    function b(e, t, n) {
        this.nodes = v(e, t, n), this._next = this.nodes[0], this._position = 0
    }

    function N(e) {
        return function (t, r) {
            var i, s = r ? t : t.parentNode;
            while (s) {
                i = s.nodeType;
                if (n.arrayContains(e, i)) return s;
                s = s.parentNode
            }
            return null
        }
    }

    function O(e, t) {
        if (A(e, t)) throw new y("INVALID_NODE_TYPE_ERR")
    }

    function M(e) {
        if (!e.startContainer) throw new i("INVALID_STATE_ERR")
    }

    function _(e, t) {
        if (!n.arrayContains(t, e.nodeType)) throw new y("INVALID_NODE_TYPE_ERR")
    }

    function D(e, t) {
        if (t < 0 || t > (n.isCharacterDataNode(e) ? e.length : e.childNodes.length)) throw new i("INDEX_SIZE_ERR")
    }

    function P(e, t) {
        if (k(e, !0) !== k(t, !0)) throw new i("WRONG_DOCUMENT_ERR")
    }

    function H(e) {
        if (L(e, !0)) throw new i("NO_MODIFICATION_ALLOWED_ERR")
    }

    function B(e, t) {
        if (!e) throw new i(t)
    }

    function j(e) {
        return !n.arrayContains(E, e.nodeType) && !k(e, !0)
    }

    function F(e, t) {
        return t <= (n.isCharacterDataNode(e) ? e.length : e.childNodes.length)
    }

    function I(e) {
        M(e);
        if (j(e.startContainer) || j(e.endContainer) || !F(e.startContainer, e.startOffset) || !F(e.endContainer, e.endOffset)) throw new Error("Range error: Range is no longer valid after DOM mutation (" + e.inspect() + ")")
    }

    function Z() {}

    function et(e) {
        e.START_TO_START = X, e.START_TO_END = V, e.END_TO_END = $, e.END_TO_START = J, e.NODE_BEFORE = K, e.NODE_AFTER = Q, e.NODE_BEFORE_AND_AFTER = G, e.NODE_INSIDE = Y
    }

    function tt(e) {
        et(e), et(e.prototype)
    }

    function nt(e, t) {
        return function () {
            I(this);
            var r = this.startContainer,
                i = this.startOffset,
                s = this.commonAncestorContainer,
                o = new g(this, !0),
                u, a;
            r !== s && (u = n.getClosestAncestorIn(r, s, !0), a = f(u), r = a.node, i = a.offset), h(o, H), o.reset();
            var l = e(o);
            return o.detach(), t(this, r, i, r, i), l
        }
    }

    function rt(t, r, i) {
        function o(e, t) {
            return function (n) {
                M(this), _(n, w), _(C(n), E);
                var r = (e ? a : f)(n);
                (t ? u : l)(this, r.node, r.offset)
            }
        }

        function u(e, t, i) {
            var s = e.endContainer,
                o = e.endOffset;
            if (t !== e.startContainer || i !== e.startOffset) {
                if (C(t) != C(s) || n.comparePoints(t, i, s, o) == 1) s = t, o = i;
                r(e, t, i, s, o)
            }
        }

        function l(e, t, i) {
            var s = e.startContainer,
                o = e.startOffset;
            if (t !== e.endContainer || i !== e.endOffset) {
                if (C(t) != C(s) || n.comparePoints(t, i, s, o) == -1) s = t, o = i;
                r(e, s, o, t, i)
            }
        }

        function c(e, t, n) {
            (t !== e.startContainer || n !== e.startOffset || t !== e.endContainer || n !== e.endOffset) && r(e, t, n, t, n)
        }
        t.prototype = new Z, e.util.extend(t.prototype, {
            setStart: function (e, t) {
                M(this), O(e, !0), D(e, t), u(this, e, t)
            },
            setEnd: function (e, t) {
                M(this), O(e, !0), D(e, t), l(this, e, t)
            },
            setStartBefore: o(!0, !0),
            setStartAfter: o(!1, !0),
            setEndBefore: o(!0, !1),
            setEndAfter: o(!1, !1),
            collapse: function (e) {
                I(this), e ? r(this, this.startContainer, this.startOffset, this.startContainer, this.startOffset) : r(this, this.endContainer, this.endOffset, this.endContainer, this.endOffset)
            },
            selectNodeContents: function (e) {
                M(this), O(e, !0), r(this, e, 0, e, n.getNodeLength(e))
            },
            selectNode: function (e) {
                M(this), O(e, !1), _(e, w);
                var t = a(e),
                    n = f(e);
                r(this, t.node, t.offset, n.node, n.offset)
            },
            extractContents: nt(d, r),
            deleteContents: nt(p, r),
            canSurroundContents: function () {
                I(this), H(this.startContainer), H(this.endContainer);
                var e = new g(this, !0),
                    t = e._first && s(e._first, this) || e._last && s(e._last, this);
                return e.detach(), !t
            },
            detach: function () {
                i(this)
            },
            splitBoundaries: function () {
                I(this);
                var e = this.startContainer,
                    t = this.startOffset,
                    i = this.endContainer,
                    s = this.endOffset,
                    o = e === i;
                n.isCharacterDataNode(i) && s > 0 && s < i.length && n.splitDataNode(i, s), n.isCharacterDataNode(e) && t > 0 && t < e.length && (e = n.splitDataNode(e, t), o ? (s -= t, i = e) : i == e.parentNode && s >= n.getNodeIndex(e) && s++, t = 0), r(this, e, t, i, s)
            },
            normalizeBoundaries: function () {
                I(this);
                var e = this.startContainer,
                    t = this.startOffset,
                    i = this.endContainer,
                    s = this.endOffset,
                    o = function (e) {
                        var t = e.nextSibling;
                        t && t.nodeType == e.nodeType && (i = e, s = e.length, e.appendData(t.data), t.parentNode.removeChild(t))
                    }, u = function (r) {
                        var o = r.previousSibling;
                        if (o && o.nodeType == r.nodeType) {
                            e = r;
                            var u = r.length;
                            t = o.length, r.insertData(0, o.data), o.parentNode.removeChild(o);
                            if (e == i) s += t, i = e;
                            else if (i == r.parentNode) {
                                var a = n.getNodeIndex(r);
                                s == a ? (i = r, s = u) : s > a && s--
                            }
                        }
                    }, a = !0;
                if (n.isCharacterDataNode(i)) i.length == s && o(i);
                else {
                    if (s > 0) {
                        var f = i.childNodes[s - 1];
                        f && n.isCharacterDataNode(f) && o(f)
                    }
                    a = !this.collapsed
                } if (a) {
                    if (n.isCharacterDataNode(e)) t == 0 && u(e);
                    else if (t < e.childNodes.length) {
                        var l = e.childNodes[t];
                        l && n.isCharacterDataNode(l) && u(l)
                    }
                } else e = i, t = s;
                r(this, e, t, i, s)
            },
            collapseToPoint: function (e, t) {
                M(this), O(e, !0), D(e, t), c(this, e, t)
            }
        }), tt(t)
    }

    function it(e) {
        e.collapsed = e.startContainer === e.endContainer && e.startOffset === e.endOffset, e.commonAncestorContainer = e.collapsed ? e.startContainer : n.getCommonAncestor(e.startContainer, e.endContainer)
    }

    function st(e, t, n, r, i) {
        var s = e.startContainer !== t || e.startOffset !== n,
            o = e.endContainer !== r || e.endOffset !== i;
        e.startContainer = t, e.startOffset = n, e.endContainer = r, e.endOffset = i, it(e), u(e, "boundarychange", {
            startMoved: s,
            endMoved: o
        })
    }

    function ot(e) {
        M(e), e.startContainer = e.startOffset = e.endContainer = e.endOffset = null, e.collapsed = e.commonAncestorContainer = null, u(e, "detach", null), e._listeners = null
    }

    function ut(e) {
        this.startContainer = e, this.startOffset = 0, this.endContainer = e, this.endOffset = 0, this._listeners = {
            boundarychange: [],
            detach: []
        }, it(this)
    }
    e.requireModules(["DomUtil"]);
    var n = e.dom,
        r = n.DomPosition,
        i = e.DOMException;
    g.prototype = {
        _current: null,
        _next: null,
        _first: null,
        _last: null,
        isSingleCharacterDataNode: !1,
        reset: function () {
            this._current = null, this._next = this._first
        },
        hasNext: function () {
            return !!this._next
        },
        next: function () {
            var e = this._current = this._next;
            return e && (this._next = e !== this._last ? e.nextSibling : null, n.isCharacterDataNode(e) && this.clonePartiallySelectedTextNodes && (e === this.ec && (e = e.cloneNode(!0)).deleteData(this.eo, e.length - this.eo), this._current === this.sc && (e = e.cloneNode(!0)).deleteData(0, this.so))), e
        },
        remove: function () {
            var e = this._current,
                t, r;
            !n.isCharacterDataNode(e) || e !== this.sc && e !== this.ec ? e.parentNode && e.parentNode.removeChild(e) : (t = e === this.sc ? this.so : 0, r = e === this.ec ? this.eo : e.length, t != r && e.deleteData(t, r - t))
        },
        isPartiallySelectedSubtree: function () {
            var e = this._current;
            return s(e, this.range)
        },
        getSubtreeIterator: function () {
            var e;
            if (this.isSingleCharacterDataNode) e = this.range.cloneRange(), e.collapse();
            else {
                e = new ut(o(this.range));
                var t = this._current,
                    r = t,
                    i = 0,
                    s = t,
                    u = n.getNodeLength(t);
                n.isAncestorOf(t, this.sc, !0) && (r = this.sc, i = this.so), n.isAncestorOf(t, this.ec, !0) && (s = this.ec, u = this.eo), st(e, r, i, s, u)
            }
            return new g(e, this.clonePartiallySelectedTextNodes)
        },
        detach: function (e) {
            e && this.range.detach(), this.range = this._current = this._next = this._first = this._last = this.sc = this.so = this.ec = this.eo = null
        }
    }, y.prototype = {
        BAD_BOUNDARYPOINTS_ERR: 1,
        INVALID_NODE_TYPE_ERR: 2
    }, y.prototype.toString = function () {
        return this.message
    }, b.prototype = {
        _current: null,
        hasNext: function () {
            return !!this._next
        },
        next: function () {
            return this._current = this._next, this._next = this.nodes[++this._position], this._current
        },
        detach: function () {
            this._current = this._next = this.nodes = null
        }
    };
    var w = [1, 3, 4, 5, 7, 8, 10],
        E = [2, 9, 11],
        S = [5, 6, 10, 12],
        x = [1, 3, 4, 5, 7, 8, 10, 11],
        T = [1, 3, 4, 5, 7, 8],
        C = n.getRootContainer,
        k = N([9, 11]),
        L = N(S),
        A = N([6, 10, 12]),
        q = document.createElement("style"),
        R = !1;
    try {
        q.innerHTML = "<b>x</b>", R = q.firstChild.nodeType == 3
    } catch (U) {}
    e.features.htmlParsingConforms = R;
    var z = R ? function (e) {
            var t = this.startContainer,
                r = n.getDocument(t);
            if (!t) throw new i("INVALID_STATE_ERR");
            var s = null;
            return t.nodeType == 1 ? s = t : n.isCharacterDataNode(t) && (s = n.parentElement(t)), s === null || s.nodeName == "HTML" && n.isHtmlNamespace(n.getDocument(s).documentElement) && n.isHtmlNamespace(s) ? s = r.createElement("body") : s = s.cloneNode(!1), s.innerHTML = e, n.fragmentFromNodeChildren(s)
        } : function (e) {
            M(this);
            var t = o(this),
                r = t.createElement("body");
            return r.innerHTML = e, n.fragmentFromNodeChildren(r)
        }, W = ["startContainer", "startOffset", "endContainer", "endOffset", "collapsed", "commonAncestorContainer"],
        X = 0,
        V = 1,
        $ = 2,
        J = 3,
        K = 0,
        Q = 1,
        G = 2,
        Y = 3;
    Z.prototype = {
        attachListener: function (e, t) {
            this._listeners[e].push(t)
        },
        compareBoundaryPoints: function (e, t) {
            I(this), P(this.startContainer, t.startContainer);
            var r, i, s, o, u = e == J || e == X ? "start" : "end",
                a = e == V || e == X ? "start" : "end";
            return r = this[u + "Container"], i = this[u + "Offset"], s = t[a + "Container"], o = t[a + "Offset"], n.comparePoints(r, i, s, o)
        },
        insertNode: function (e) {
            I(this), _(e, x), H(this.startContainer);
            if (n.isAncestorOf(e, this.startContainer, !0)) throw new i("HIERARCHY_REQUEST_ERR");
            var t = l(e, this.startContainer, this.startOffset);
            this.setStartBefore(t)
        },
        cloneContents: function () {
            I(this);
            var e, t;
            if (this.collapsed) return o(this).createDocumentFragment();
            if (this.startContainer === this.endContainer && n.isCharacterDataNode(this.startContainer)) return e = this.startContainer.cloneNode(!0), e.data = e.data.slice(this.startOffset, this.endOffset), t = o(this).createDocumentFragment(), t.appendChild(e), t;
            var r = new g(this, !0);
            return e = c(r), r.detach(), e
        },
        canSurroundContents: function () {
            I(this), H(this.startContainer), H(this.endContainer);
            var e = new g(this, !0),
                t = e._first && s(e._first, this) || e._last && s(e._last, this);
            return e.detach(), !t
        },
        surroundContents: function (e) {
            _(e, T);
            if (!this.canSurroundContents()) throw new y("BAD_BOUNDARYPOINTS_ERR");
            var t = this.extractContents();
            if (e.hasChildNodes())
                while (e.lastChild) e.removeChild(e.lastChild);
            l(e, this.startContainer, this.startOffset), e.appendChild(t), this.selectNode(e)
        },
        cloneRange: function () {
            I(this);
            var e = new ut(o(this)),
                t = W.length,
                n;
            while (t--) n = W[t], e[n] = this[n];
            return e
        },
        toString: function () {
            I(this);
            var e = this.startContainer;
            if (e === this.endContainer && n.isCharacterDataNode(e)) return e.nodeType == 3 || e.nodeType == 4 ? e.data.slice(this.startOffset, this.endOffset) : "";
            var t = [],
                r = new g(this, !0);
            return h(r, function (e) {
                (e.nodeType == 3 || e.nodeType == 4) && t.push(e.data)
            }), r.detach(), t.join("")
        },
        compareNode: function (e) {
            I(this);
            var t = e.parentNode,
                r = n.getNodeIndex(e);
            if (!t) throw new i("NOT_FOUND_ERR");
            var s = this.comparePoint(t, r),
                o = this.comparePoint(t, r + 1);
            return s < 0 ? o > 0 ? G : K : o > 0 ? Q : Y
        },
        comparePoint: function (e, t) {
            return I(this), B(e, "HIERARCHY_REQUEST_ERR"), P(e, this.startContainer), n.comparePoints(e, t, this.startContainer, this.startOffset) < 0 ? -1 : n.comparePoints(e, t, this.endContainer, this.endOffset) > 0 ? 1 : 0
        },
        createContextualFragment: z,
        toHtml: function () {
            I(this);
            var e = o(this).createElement("div");
            return e.appendChild(this.cloneContents()), e.innerHTML
        },
        intersectsNode: function (e, t) {
            I(this), B(e, "NOT_FOUND_ERR");
            if (n.getDocument(e) !== o(this)) return !1;
            var r = e.parentNode,
                i = n.getNodeIndex(e);
            B(r, "NOT_FOUND_ERR");
            var s = n.comparePoints(r, i, this.endContainer, this.endOffset),
                u = n.comparePoints(r, i + 1, this.startContainer, this.startOffset);
            return t ? s <= 0 && u >= 0 : s < 0 && u > 0
        },
        isPointInRange: function (e, t) {
            return I(this), B(e, "HIERARCHY_REQUEST_ERR"), P(e, this.startContainer), n.comparePoints(e, t, this.startContainer, this.startOffset) >= 0 && n.comparePoints(e, t, this.endContainer, this.endOffset) <= 0
        },
        intersectsRange: function (e, t) {
            I(this);
            if (o(e) != o(this)) throw new i("WRONG_DOCUMENT_ERR");
            var r = n.comparePoints(this.startContainer, this.startOffset, e.endContainer, e.endOffset),
                s = n.comparePoints(this.endContainer, this.endOffset, e.startContainer, e.startOffset);
            return t ? r <= 0 && s >= 0 : r < 0 && s > 0
        },
        intersection: function (e) {
            if (this.intersectsRange(e)) {
                var t = n.comparePoints(this.startContainer, this.startOffset, e.startContainer, e.startOffset),
                    r = n.comparePoints(this.endContainer, this.endOffset, e.endContainer, e.endOffset),
                    i = this.cloneRange();
                return t == -1 && i.setStart(e.startContainer, e.startOffset), r == 1 && i.setEnd(e.endContainer, e.endOffset), i
            }
            return null
        },
        union: function (e) {
            if (this.intersectsRange(e, !0)) {
                var t = this.cloneRange();
                return n.comparePoints(e.startContainer, e.startOffset, this.startContainer, this.startOffset) == -1 && t.setStart(e.startContainer, e.startOffset), n.comparePoints(e.endContainer, e.endOffset, this.endContainer, this.endOffset) == 1 && t.setEnd(e.endContainer, e.endOffset), t
            }
            throw new y("Ranges do not intersect")
        },
        containsNode: function (e, t) {
            return t ? this.intersectsNode(e, !1) : this.compareNode(e) == Y
        },
        containsNodeContents: function (e) {
            return this.comparePoint(e, 0) >= 0 && this.comparePoint(e, n.getNodeLength(e)) <= 0
        },
        containsRange: function (e) {
            return this.intersection(e).equals(e)
        },
        containsNodeText: function (e) {
            var t = this.cloneRange();
            t.selectNode(e);
            var n = t.getNodes([3]);
            if (n.length > 0) {
                t.setStart(n[0], 0);
                var r = n.pop();
                t.setEnd(r, r.length);
                var i = this.containsRange(t);
                return t.detach(), i
            }
            return this.containsNodeContents(e)
        },
        createNodeIterator: function (e, t) {
            return I(this), new b(this, e, t)
        },
        getNodes: function (e, t) {
            return I(this), v(this, e, t)
        },
        getDocument: function () {
            return o(this)
        },
        collapseBefore: function (e) {
            M(this), this.setEndBefore(e), this.collapse(!1)
        },
        collapseAfter: function (e) {
            M(this), this.setStartAfter(e), this.collapse(!0)
        },
        getName: function () {
            return "DomRange"
        },
        equals: function (e) {
            return ut.rangesEqual(this, e)
        },
        inspect: function () {
            return m(this)
        }
    }, rt(ut, st, ot), e.rangePrototype = Z.prototype, ut.rangeProperties = W, ut.RangeIterator = g, ut.copyComparisonConstants = tt, ut.createPrototypeRange = rt, ut.inspect = m, ut.getRangeDocument = o, ut.rangesEqual = function (e, t) {
        return e.startContainer === t.startContainer && e.startOffset === t.startOffset && e.endContainer === t.endContainer && e.endOffset === t.endOffset
    }, e.DomRange = ut, e.RangeException = y
}), rangy.createModule("WrappedRange", function (e, t) {
    function o(e) {
        var t = e.parentElement(),
            n = e.duplicate();
        n.collapse(!0);
        var i = n.parentElement();
        n = e.duplicate(), n.collapse(!1);
        var s = n.parentElement(),
            o = i == s ? i : r.getCommonAncestor(i, s);
        return o == t ? o : r.getCommonAncestor(t, o)
    }

    function u(e) {
        return e.compareEndPoints("StartToEnd", e) == 0
    }

    function a(e, t, n, s) {
        var o = e.duplicate();
        o.collapse(n);
        var u = o.parentElement();
        r.isAncestorOf(t, u, !0) || (u = t);
        if (!u.canHaveHTML) return new i(u.parentNode, r.getNodeIndex(u));
        var a = r.getDocument(u).createElement("span"),
            f, l = n ? "StartToStart" : "StartToEnd",
            c, h, p, d;
        do u.insertBefore(a, a.previousSibling), o.moveToElementText(a); while ((f = o.compareEndPoints(l, e)) > 0 && a.previousSibling);
        d = a.nextSibling;
        if (f == -1 && d && r.isCharacterDataNode(d)) {
            o.setEndPoint(n ? "EndToStart" : "EndToEnd", e);
            var v;
            if (/[\r\n]/.test(d.data)) {
                var m = o.duplicate(),
                    g = m.text.replace(/\r\n/g, "\r").length;
                v = m.moveStart("character", g);
                while ((f = m.compareEndPoints("StartToEnd", m)) == -1) v++, m.moveStart("character", 1)
            } else v = o.text.length;
            p = new i(d, v)
        } else c = (s || !n) && a.previousSibling, h = (s || n) && a.nextSibling, h && r.isCharacterDataNode(h) ? p = new i(h, 0) : c && r.isCharacterDataNode(c) ? p = new i(c, c.length) : p = new i(u, r.getNodeIndex(a));
        return a.parentNode.removeChild(a), p
    }

    function f(e, t) {
        var n, i, s = e.offset,
            o = r.getDocument(e.node),
            u, a, f = o.body.createTextRange(),
            l = r.isCharacterDataNode(e.node);
        return l ? (n = e.node, i = n.parentNode) : (a = e.node.childNodes, n = s < a.length ? a[s] : null, i = e.node), u = o.createElement("span"), u.innerHTML = "&#feff;", n ? i.insertBefore(u, n) : i.appendChild(u), f.moveToElementText(u), f.collapse(!t), i.removeChild(u), l && f[t ? "moveStart" : "moveEnd"]("character", s), f
    }
    e.requireModules(["DomUtil", "DomRange"]);
    var n, r = e.dom,
        i = r.DomPosition,
        s = e.DomRange;
    if (e.features.implementsDomRange && (!e.features.implementsTextRange || !e.config.preferTextRange))(function () {
        function u(e) {
            var t = i.length,
                n;
            while (t--) n = i[t], e[n] = e.nativeRange[n]
        }

        function a(e, t, n, r, i) {
            var s = e.startContainer !== t || e.startOffset != n,
                o = e.endContainer !== r || e.endOffset != i;
            if (s || o) e.setEnd(r, i), e.setStart(t, n)
        }

        function f(e) {
            e.nativeRange.detach(), e.detached = !0;
            var t = i.length,
                n;
            while (t--) n = i[t], e[n] = null
        }
        var t, i = s.rangeProperties,
            o, l;
        n = function (e) {
            if (!e) throw new Error("Range must be specified");
            this.nativeRange = e, u(this)
        }, s.createPrototypeRange(n, a, f), t = n.prototype, t.selectNode = function (e) {
            this.nativeRange.selectNode(e), u(this)
        }, t.deleteContents = function () {
            this.nativeRange.deleteContents(), u(this)
        }, t.extractContents = function () {
            var e = this.nativeRange.extractContents();
            return u(this), e
        }, t.cloneContents = function () {
            return this.nativeRange.cloneContents()
        }, t.surroundContents = function (e) {
            this.nativeRange.surroundContents(e), u(this)
        }, t.collapse = function (e) {
            this.nativeRange.collapse(e), u(this)
        }, t.cloneRange = function () {
            return new n(this.nativeRange.cloneRange())
        }, t.refresh = function () {
            u(this)
        }, t.toString = function () {
            return this.nativeRange.toString()
        };
        var c = document.createTextNode("test");
        r.getBody(document).appendChild(c);
        var h = document.createRange();
        h.setStart(c, 0), h.setEnd(c, 0);
        try {
            h.setStart(c, 1), o = !0, t.setStart = function (e, t) {
                this.nativeRange.setStart(e, t), u(this)
            }, t.setEnd = function (e, t) {
                this.nativeRange.setEnd(e, t), u(this)
            }, l = function (e) {
                return function (t) {
                    this.nativeRange[e](t), u(this)
                }
            }
        } catch (p) {
            o = !1, t.setStart = function (e, t) {
                try {
                    this.nativeRange.setStart(e, t)
                } catch (n) {
                    this.nativeRange.setEnd(e, t), this.nativeRange.setStart(e, t)
                }
                u(this)
            }, t.setEnd = function (e, t) {
                try {
                    this.nativeRange.setEnd(e, t)
                } catch (n) {
                    this.nativeRange.setStart(e, t), this.nativeRange.setEnd(e, t)
                }
                u(this)
            }, l = function (e, t) {
                return function (n) {
                    try {
                        this.nativeRange[e](n)
                    } catch (r) {
                        this.nativeRange[t](n), this.nativeRange[e](n)
                    }
                    u(this)
                }
            }
        }
        t.setStartBefore = l("setStartBefore", "setEndBefore"), t.setStartAfter = l("setStartAfter", "setEndAfter"), t.setEndBefore = l("setEndBefore", "setStartBefore"), t.setEndAfter = l("setEndAfter", "setStartAfter"), h.selectNodeContents(c), h.startContainer == c && h.endContainer == c && h.startOffset == 0 && h.endOffset == c.length ? t.selectNodeContents = function (e) {
            this.nativeRange.selectNodeContents(e), u(this)
        } : t.selectNodeContents = function (e) {
            this.setStart(e, 0), this.setEnd(e, s.getEndOffset(e))
        }, h.selectNodeContents(c), h.setEnd(c, 3);
        var d = document.createRange();
        d.selectNodeContents(c), d.setEnd(c, 4), d.setStart(c, 2), h.compareBoundaryPoints(h.START_TO_END, d) == -1 & h.compareBoundaryPoints(h.END_TO_START, d) == 1 ? t.compareBoundaryPoints = function (e, t) {
            return t = t.nativeRange || t, e == t.START_TO_END ? e = t.END_TO_START : e == t.END_TO_START && (e = t.START_TO_END), this.nativeRange.compareBoundaryPoints(e, t)
        } : t.compareBoundaryPoints = function (e, t) {
            return this.nativeRange.compareBoundaryPoints(e, t.nativeRange || t)
        }, e.util.isHostMethod(h, "createContextualFragment") && (t.createContextualFragment = function (e) {
            return this.nativeRange.createContextualFragment(e)
        }), r.getBody(document).removeChild(c), h.detach(), d.detach()
    })(), e.createNativeRange = function (e) {
        return e = e || document, e.createRange()
    };
    else if (e.features.implementsTextRange) {
        n = function (e) {
            this.textRange = e, this.refresh()
        }, n.prototype = new s(document), n.prototype.refresh = function () {
            var e, t, n = o(this.textRange);
            u(this.textRange) ? t = e = a(this.textRange, n, !0, !0) : (e = a(this.textRange, n, !0, !1), t = a(this.textRange, n, !1, !1)), this.setStart(e.node, e.offset), this.setEnd(t.node, t.offset)
        }, s.copyComparisonConstants(n);
        var l = function () {
            return this
        }();
        typeof l.Range == "undefined" && (l.Range = n), e.createNativeRange = function (e) {
            return e = e || document, e.body.createTextRange()
        }
    }
    e.features.implementsTextRange && (n.rangeToTextRange = function (e) {
        if (e.collapsed) {
            var t = f(new i(e.startContainer, e.startOffset), !0);
            return t
        }
        var n = f(new i(e.startContainer, e.startOffset), !0),
            s = f(new i(e.endContainer, e.endOffset), !1),
            o = r.getDocument(e.startContainer).body.createTextRange();
        return o.setEndPoint("StartToStart", n), o.setEndPoint("EndToEnd", s), o
    }), n.prototype.getName = function () {
        return "WrappedRange"
    }, e.WrappedRange = n, e.createRange = function (t) {
        return t = t || document, new n(e.createNativeRange(t))
    }, e.createRangyRange = function (e) {
        return e = e || document, new s(e)
    }, e.createIframeRange = function (t) {
        return e.createRange(r.getIframeDocument(t))
    }, e.createIframeRangyRange = function (t) {
        return e.createRangyRange(r.getIframeDocument(t))
    }, e.addCreateMissingNativeApiListener(function (t) {
        var n = t.document;
        typeof n.createRange == "undefined" && (n.createRange = function () {
            return e.createRange(this)
        }), n = t = null
    })
}), rangy.createModule("WrappedSelection", function (e, t) {
    function p(e) {
        return (e || window).getSelection()
    }

    function d(e) {
        return (e || window).document.selection
    }

    function L(e, t, n) {
        var r = n ? "end" : "start",
            i = n ? "start" : "end";
        e.anchorNode = t[r + "Container"], e.anchorOffset = t[r + "Offset"], e.focusNode = t[i + "Container"], e.focusOffset = t[i + "Offset"]
    }

    function A(e) {
        var t = e.nativeSelection;
        e.anchorNode = t.anchorNode, e.anchorOffset = t.anchorOffset, e.focusNode = t.focusNode, e.focusOffset = t.focusOffset
    }

    function O(e) {
        e.anchorNode = e.focusNode = null, e.anchorOffset = e.focusOffset = 0, e.rangeCount = 0, e.isCollapsed = !0, e._ranges.length = 0
    }

    function M(t) {
        var n;
        return t instanceof o ? (n = t._selectionNativeRange, n || (n = e.createNativeRange(i.getDocument(t.startContainer)), n.setEnd(t.endContainer, t.endOffset), n.setStart(t.startContainer, t.startOffset), t._selectionNativeRange = n, t.attachListener("detach", function () {
            this._selectionNativeRange = null
        }))) : t instanceof u ? n = t.nativeRange : e.features.implementsDomRange && t instanceof i.getWindow(t.startContainer).Range && (n = t), n
    }

    function _(e) {
        if (!e.length || e[0].nodeType != 1) return !1;
        for (var t = 1, n = e.length; t < n; ++t)
            if (!i.isAncestorOf(e[0], e[t])) return !1;
        return !0
    }

    function D(e) {
        var t = e.getNodes();
        if (!_(t)) throw new Error("getSingleElementFromRange: range " + e.inspect() + " did not consist of a single element");
        return t[0]
    }

    function P(e) {
        return !!e && typeof e.text != "undefined"
    }

    function H(e, t) {
        var n = new u(t);
        e._ranges = [n], L(e, n, !1), e.rangeCount = 1, e.isCollapsed = n.collapsed
    }

    function B(t) {
        t._ranges.length = 0;
        if (t.docSelection.type == "None") O(t);
        else {
            var n = t.docSelection.createRange();
            if (P(n)) H(t, n);
            else {
                t.rangeCount = n.length;
                var r, s = i.getDocument(n.item(0));
                for (var o = 0; o < t.rangeCount; ++o) r = e.createRange(s), r.selectNode(n.item(o)), t._ranges.push(r);
                t.isCollapsed = t.rangeCount == 1 && t._ranges[0].collapsed, L(t, t._ranges[t.rangeCount - 1], !1)
            }
        }
    }

    function j(e, t) {
        var n = e.docSelection.createRange(),
            r = D(t),
            s = i.getDocument(n.item(0)),
            o = i.getBody(s).createControlRange();
        for (var u = 0, a = n.length; u < a; ++u) o.add(n.item(u));
        try {
            o.add(r)
        } catch (f) {
            throw new Error("addRange(): Element within the specified Range could not be added to control selection (does it have layout?)")
        }
        o.select(), B(e)
    }

    function I(e, t, n) {
        this.nativeSelection = e, this.docSelection = t, this._ranges = [], this.win = n, this.refresh()
    }

    function R(e, t) {
        var n = i.getDocument(t[0].startContainer),
            r = i.getBody(n).createControlRange();
        for (var s = 0, o; s < rangeCount; ++s) {
            o = D(t[s]);
            try {
                r.add(o)
            } catch (u) {
                throw new Error("setRanges(): Element within the one of the specified Ranges could not be added to control selection (does it have layout?)")
            }
        }
        r.select(), B(e)
    }

    function V(e, t) {
        if (e.anchorNode && i.getDocument(e.anchorNode) !== i.getDocument(t)) throw new a("WRONG_DOCUMENT_ERR")
    }

    function $(e) {
        var t = [],
            n = new f(e.anchorNode, e.anchorOffset),
            r = new f(e.focusNode, e.focusOffset),
            i = typeof e.getName == "function" ? e.getName() : "Selection";
        if (typeof e.rangeCount != "undefined")
            for (var s = 0, u = e.rangeCount; s < u; ++s) t[s] = o.inspect(e.getRangeAt(s));
        return "[" + i + "(Ranges: " + t.join(", ") + ")(anchor: " + n.inspect() + ", focus: " + r.inspect() + "]"
    }
    e.requireModules(["DomUtil", "DomRange", "WrappedRange"]), e.config.checkSelectionRanges = !0;
    var n = "boolean",
        r = "_rangySelection",
        i = e.dom,
        s = e.util,
        o = e.DomRange,
        u = e.WrappedRange,
        a = e.DOMException,
        f = i.DomPosition,
        l, c, h = "Control",
        v = e.util.isHostMethod(window, "getSelection"),
        m = e.util.isHostObject(document, "selection"),
        g = m && (!v || e.config.preferTextRange);
    g ? (l = d, e.isSelectionValid = function (e) {
        var t = (e || window).document,
            n = t.selection;
        return n.type != "None" || i.getDocument(n.createRange().parentElement()) == t
    }) : v ? (l = p, e.isSelectionValid = function () {
        return !0
    }) : t.fail("Neither document.selection or window.getSelection() detected."), e.getNativeSelection = l;
    var y = l(),
        b = e.createNativeRange(document),
        w = i.getBody(document),
        E = s.areHostObjects(y, ["anchorNode", "focusNode"] && s.areHostProperties(y, ["anchorOffset", "focusOffset"]));
    e.features.selectionHasAnchorAndFocus = E;
    var S = s.isHostMethod(y, "extend");
    e.features.selectionHasExtend = S;
    var x = typeof y.rangeCount == "number";
    e.features.selectionHasRangeCount = x;
    var T = !1,
        N = !0;
    s.areHostMethods(y, ["addRange", "getRangeAt", "removeAllRanges"]) && typeof y.rangeCount == "number" && e.features.implementsDomRange && function () {
        var e = document.createElement("iframe");
        w.appendChild(e);
        var t = i.getIframeDocument(e);
        t.open(), t.write("<html><head></head><body>12</body></html>"), t.close();
        var n = i.getIframeWindow(e).getSelection(),
            r = t.documentElement,
            s = r.lastChild,
            o = s.firstChild,
            u = t.createRange();
        u.setStart(o, 1), u.collapse(!0), n.addRange(u), N = n.rangeCount == 1, n.removeAllRanges();
        var a = u.cloneRange();
        u.setStart(o, 0), a.setEnd(o, 2), n.addRange(u), n.addRange(a), T = n.rangeCount == 2, u.detach(), a.detach(), w.removeChild(e)
    }(), e.features.selectionSupportsMultipleRanges = T, e.features.collapsedNonEditableSelectionsSupported = N;
    var C = !1,
        k;
    w && s.isHostMethod(w, "createControlRange") && (k = w.createControlRange(), s.areHostProperties(k, ["item", "add"]) && (C = !0)), e.features.implementsControlRange = C, E ? c = function (e) {
        return e.anchorNode === e.focusNode && e.anchorOffset === e.focusOffset
    } : c = function (e) {
        return e.rangeCount ? e.getRangeAt(e.rangeCount - 1).collapsed : !1
    };
    var F;
    s.isHostMethod(y, "getRangeAt") ? F = function (e, t) {
        try {
            return e.getRangeAt(t)
        } catch (n) {
            return null
        }
    } : E && (F = function (t) {
        var n = i.getDocument(t.anchorNode),
            r = e.createRange(n);
        return r.setStart(t.anchorNode, t.anchorOffset), r.setEnd(t.focusNode, t.focusOffset), r.collapsed !== this.isCollapsed && (r.setStart(t.focusNode, t.focusOffset), r.setEnd(t.anchorNode, t.anchorOffset)), r
    }), e.getSelection = function (e) {
        e = e || window;
        var t = e[r],
            n = l(e),
            i = m ? d(e) : null;
        return t ? (t.nativeSelection = n, t.docSelection = i, t.refresh(e)) : (t = new I(n, i, e), e[r] = t), t
    }, e.getIframeSelection = function (t) {
        return e.getSelection(i.getIframeWindow(t))
    };
    var q = I.prototype;
    if (!g && E && s.areHostMethods(y, ["removeAllRanges", "addRange"])) {
        q.removeAllRanges = function () {
            this.nativeSelection.removeAllRanges(), O(this)
        };
        var U = function (t, n) {
            var r = o.getRangeDocument(n),
                i = e.createRange(r);
            i.collapseToPoint(n.endContainer, n.endOffset), t.nativeSelection.addRange(M(i)), t.nativeSelection.extend(n.startContainer, n.startOffset), t.refresh()
        };
        x ? q.addRange = function (t, n) {
            if (C && m && this.docSelection.type == h) j(this, t);
            else if (n && S) U(this, t);
            else {
                var r;
                T ? r = this.rangeCount : (this.removeAllRanges(), r = 0), this.nativeSelection.addRange(M(t)), this.rangeCount = this.nativeSelection.rangeCount;
                if (this.rangeCount == r + 1) {
                    if (e.config.checkSelectionRanges) {
                        var i = F(this.nativeSelection, this.rangeCount - 1);
                        i && !o.rangesEqual(i, t) && (t = new u(i))
                    }
                    this._ranges[this.rangeCount - 1] = t, L(this, t, X(this.nativeSelection)), this.isCollapsed = c(this)
                } else this.refresh()
            }
        } : q.addRange = function (e, t) {
            t && S ? U(this, e) : (this.nativeSelection.addRange(M(e)), this.refresh())
        }, q.setRanges = function (e) {
            if (C && e.length > 1) R(this, e);
            else {
                this.removeAllRanges();
                for (var t = 0, n = e.length; t < n; ++t) this.addRange(e[t])
            }
        }
    } else {
        if (!(s.isHostMethod(y, "empty") && s.isHostMethod(b, "select") && C && g)) return t.fail("No means of selecting a Range or TextRange was found"), !1;
        q.removeAllRanges = function () {
            try {
                this.docSelection.empty();
                if (this.docSelection.type != "None") {
                    var e;
                    if (this.anchorNode) e = i.getDocument(this.anchorNode);
                    else if (this.docSelection.type == h) {
                        var t = this.docSelection.createRange();
                        t.length && (e = i.getDocument(t.item(0)).body.createTextRange())
                    }
                    if (e) {
                        var n = e.body.createTextRange();
                        n.select(), this.docSelection.empty()
                    }
                }
            } catch (r) {}
            O(this)
        }, q.addRange = function (e) {
            this.docSelection.type == h ? j(this, e) : (u.rangeToTextRange(e).select(), this._ranges[0] = e, this.rangeCount = 1, this.isCollapsed = this._ranges[0].collapsed, L(this, e, !1))
        }, q.setRanges = function (e) {
            this.removeAllRanges();
            var t = e.length;
            t > 1 ? R(this, e) : t && this.addRange(e[0])
        }
    }
    q.getRangeAt = function (e) {
        if (e < 0 || e >= this.rangeCount) throw new a("INDEX_SIZE_ERR");
        return this._ranges[e]
    };
    var z;
    if (g) z = function (t) {
        var n;
        e.isSelectionValid(t.win) ? n = t.docSelection.createRange() : (n = i.getBody(t.win.document).createTextRange(), n.collapse(!0)), t.docSelection.type == h ? B(t) : P(n) ? H(t, n) : O(t)
    };
    else if (s.isHostMethod(y, "getRangeAt") && typeof y.rangeCount == "number") z = function (t) {
        if (C && m && t.docSelection.type == h) B(t);
        else {
            t._ranges.length = t.rangeCount = t.nativeSelection.rangeCount;
            if (t.rangeCount) {
                for (var n = 0, r = t.rangeCount; n < r; ++n) t._ranges[n] = new e.WrappedRange(t.nativeSelection.getRangeAt(n));
                L(t, t._ranges[t.rangeCount - 1], X(t.nativeSelection)), t.isCollapsed = c(t)
            } else O(t)
        }
    };
    else {
        if (!E || typeof y.isCollapsed != n || typeof b.collapsed != n || !e.features.implementsDomRange) return t.fail("No means of obtaining a Range or TextRange from the user's selection was found"), !1;
        z = function (e) {
            var t, n = e.nativeSelection;
            n.anchorNode ? (t = F(n, 0), e._ranges = [t], e.rangeCount = 1, A(e), e.isCollapsed = c(e)) : O(e)
        }
    }
    q.refresh = function (e) {
        var t = e ? this._ranges.slice(0) : null;
        z(this);
        if (e) {
            var n = t.length;
            if (n != this._ranges.length) return !1;
            while (n--)
                if (!o.rangesEqual(t[n], this._ranges[n])) return !1;
            return !0
        }
    };
    var W = function (e, t) {
        var n = e.getAllRanges(),
            r = !1;
        e.removeAllRanges();
        for (var i = 0, s = n.length; i < s; ++i) r || t !== n[i] ? e.addRange(n[i]) : r = !0;
        e.rangeCount || O(e)
    };
    C ? q.removeRange = function (e) {
        if (this.docSelection.type == h) {
            var t = this.docSelection.createRange(),
                n = D(e),
                r = i.getDocument(t.item(0)),
                s = i.getBody(r).createControlRange(),
                o, u = !1;
            for (var a = 0, f = t.length; a < f; ++a) o = t.item(a), o !== n || u ? s.add(t.item(a)) : u = !0;
            s.select(), B(this)
        } else W(this, e)
    } : q.removeRange = function (e) {
        W(this, e)
    };
    var X;
    !g && E && e.features.implementsDomRange ? (X = function (e) {
        var t = !1;
        return e.anchorNode && (t = i.comparePoints(e.anchorNode, e.anchorOffset, e.focusNode, e.focusOffset) == 1), t
    }, q.isBackwards = function () {
        return X(this)
    }) : X = q.isBackwards = function () {
        return !1
    }, q.toString = function () {
        var e = [];
        for (var t = 0, n = this.rangeCount; t < n; ++t) e[t] = "" + this._ranges[t];
        return e.join("")
    }, q.collapse = function (t, n) {
        V(this, t);
        var r = e.createRange(i.getDocument(t));
        r.collapseToPoint(t, n), this.removeAllRanges(), this.addRange(r), this.isCollapsed = !0
    }, q.collapseToStart = function () {
        if (!this.rangeCount) throw new a("INVALID_STATE_ERR");
        var e = this._ranges[0];
        this.collapse(e.startContainer, e.startOffset)
    }, q.collapseToEnd = function () {
        if (!this.rangeCount) throw new a("INVALID_STATE_ERR");
        var e = this._ranges[this.rangeCount - 1];
        this.collapse(e.endContainer, e.endOffset)
    }, q.selectAllChildren = function (t) {
        V(this, t);
        var n = e.createRange(i.getDocument(t));
        n.selectNodeContents(t), this.removeAllRanges(), this.addRange(n)
    }, q.deleteFromDocument = function () {
        if (C && m && this.docSelection.type == h) {
            var e = this.docSelection.createRange(),
                t;
            while (e.length) t = e.item(0), e.remove(t), t.parentNode.removeChild(t);
            this.refresh()
        } else if (this.rangeCount) {
            var n = this.getAllRanges();
            this.removeAllRanges();
            for (var r = 0, i = n.length; r < i; ++r) n[r].deleteContents();
            this.addRange(n[i - 1])
        }
    }, q.getAllRanges = function () {
        return this._ranges.slice(0)
    }, q.setSingleRange = function (e) {
        this.setRanges([e])
    }, q.containsNode = function (e, t) {
        for (var n = 0, r = this._ranges.length; n < r; ++n)
            if (this._ranges[n].containsNode(e, t)) return !0;
        return !1
    }, q.toHtml = function () {
        var e = "";
        if (this.rangeCount) {
            var t = o.getRangeDocument(this._ranges[0]).createElement("div");
            for (var n = 0, r = this._ranges.length; n < r; ++n) t.appendChild(this._ranges[n].cloneContents());
            e = t.innerHTML
        }
        return e
    }, q.getName = function () {
        return "WrappedSelection"
    }, q.inspect = function () {
        return $(this)
    }, q.detach = function () {
        this.win[r] = null, this.win = this.anchorNode = this.focusNode = null
    }, I.inspect = $, e.Selection = I, e.selectionPrototype = q, e.addCreateMissingNativeApiListener(function (t) {
        typeof t.getSelection == "undefined" && (t.getSelection = function () {
            return e.getSelection(this)
        }), t = null
    })
});
var Base = function () {};
Base.extend = function (e, t) {
    var n = Base.prototype.extend;
    Base._prototyping = !0;
    var r = new this;
    n.call(r, e), r.base = function () {}, delete Base._prototyping;
    var i = r.constructor,
        s = r.constructor = function () {
            if (!Base._prototyping)
                if (this._constructing || this.constructor == s) this._constructing = !0, i.apply(this, arguments), delete this._constructing;
                else if (arguments[0] != null) return (arguments[0].extend || n).call(arguments[0], r)
        };
    return s.ancestor = this, s.extend = this.extend, s.forEach = this.forEach, s.implement = this.implement, s.prototype = r, s.toString = this.toString, s.valueOf = function (e) {
        return e == "object" ? s : i.valueOf()
    }, n.call(s, t), typeof s.init == "function" && s.init(), s
}, Base.prototype = {
    extend: function (e, t) {
        if (arguments.length > 1) {
            var n = this[e];
            if (n && typeof t == "function" && (!n.valueOf || n.valueOf() != t.valueOf()) && /\bbase\b/.test(t)) {
                var r = t.valueOf();
                t = function () {
                    var e = this.base || Base.prototype.base;
                    this.base = n;
                    var t = r.apply(this, arguments);
                    return this.base = e, t
                }, t.valueOf = function (e) {
                    return e == "object" ? t : r
                }, t.toString = Base.toString
            }
            this[e] = t
        } else if (e) {
            var i = Base.prototype.extend;
            !Base._prototyping && typeof this != "function" && (i = this.extend || i);
            var s = {
                toSource: null
            }, o = ["constructor", "toString", "valueOf"],
                u = Base._prototyping ? 0 : 1;
            while (a = o[u++]) e[a] != s[a] && i.call(this, a, e[a]);
            for (var a in e) s[a] || i.call(this, a, e[a])
        }
        return this
    }
}, Base = Base.extend({
    constructor: function () {
        this.extend(arguments[0])
    }
}, {
    ancestor: Object,
    version: "1.1",
    forEach: function (e, t, n) {
        for (var r in e) this.prototype[r] === undefined && t.call(n, e[r], r, e)
    },
    implement: function () {
        for (var e = 0; e < arguments.length; e++) typeof arguments[e] == "function" ? arguments[e](this.prototype) : this.prototype.extend(arguments[e]);
        return this
    },
    toString: function () {
        return String(this.valueOf())
    }
}), wysihtml5.browser = function () {
    function u(e) {
        return (/ipad|iphone|ipod/.test(e) && e.match(/ os (\d+).+? like mac os x/) || [, 0])[1]
    }
    var e = navigator.userAgent,
        t = document.createElement("div"),
        n = e.indexOf("MSIE") !== -1 && e.indexOf("Opera") === -1,
        r = e.indexOf("Gecko") !== -1 && e.indexOf("KHTML") === -1,
        i = e.indexOf("AppleWebKit/index.html") !== -1,
        s = e.indexOf("Chrome/index.html") !== -1,
        o = e.indexOf("Opera/index.html") !== -1;
    return {
        USER_AGENT: e,
        supported: function () {
            var e = this.USER_AGENT.toLowerCase(),
                n = "contentEditable" in t,
                r = document.execCommand && document.queryCommandSupported && document.queryCommandState,
                i = document.querySelector && document.querySelectorAll,
                s = this.isIos() && u(e) < 5 || e.indexOf("opera mobi") !== -1 || e.indexOf("hpwos/index.html") !== -1;
            return n && r && i && !s
        },
        isTouchDevice: function () {
            return this.supportsEvent("touchmove")
        },
        isIos: function () {
            var e = this.USER_AGENT.toLowerCase();
            return e.indexOf("webkit") !== -1 && e.indexOf("mobile") !== -1
        },
        supportsSandboxedIframes: function () {
            return n
        },
        throwsMixedContentWarningWhenIframeSrcIsEmpty: function () {
            return !("querySelector" in document)
        },
        displaysCaretInEmptyContentEditableCorrectly: function () {
            return !r
        },
        hasCurrentStyleProperty: function () {
            return "currentStyle" in t
        },
        insertsLineBreaksOnReturn: function () {
            return r
        },
        supportsPlaceholderAttributeOn: function (e) {
            return "placeholder" in e
        },
        supportsEvent: function (e) {
            return "on" + e in t || function () {
                return t.setAttribute("on" + e, "return;"), typeof t["on" + e] == "function"
            }()
        },
        supportsEventsInIframeCorrectly: function () {
            return !o
        },
        firesOnDropOnlyWhenOnDragOverIsCancelled: function () {
            return i || r
        },
        supportsDataTransfer: function () {
            try {
                return i && (window.Clipboard || window.DataTransfer).prototype.getData
            } catch (e) {
                return !1
            }
        },
        supportsHTML5Tags: function (e) {
            var t = e.createElement("div"),
                n = "<article>foo</article>";
            return t.innerHTML = n, t.innerHTML.toLowerCase() === n
        },
        supportsCommand: function () {
            var e = {
                formatBlock: n,
                insertUnorderedList: n || o || i,
                insertOrderedList: n || o || i
            }, t = {
                    insertHTML: r
                };
            return function (n, r) {
                var i = e[r];
                if (!i) {
                    try {
                        return n.queryCommandSupported(r)
                    } catch (s) {}
                    try {
                        return n.queryCommandEnabled(r)
                    } catch (o) {
                        return !!t[r]
                    }
                }
                return !1
            }
        }(),
        doesAutoLinkingInContentEditable: function () {
            return n
        },
        canDisableAutoLinking: function () {
            return this.supportsCommand(document, "AutoUrlDetect")
        },
        clearsContentEditableCorrectly: function () {
            return r || o || i
        },
        supportsGetAttributeCorrectly: function () {
            var e = document.createElement("td");
            return e.getAttribute("rowspan") != "1"
        },
        canSelectImagesInContentEditable: function () {
            return r || n || o
        },
        clearsListsInContentEditableCorrectly: function () {
            return r || n || i
        },
        autoScrollsToCaret: function () {
            return !i
        },
        autoClosesUnclosedTags: function () {
            var e = t.cloneNode(!1),
                n, r;
            return e.innerHTML = "<p><div></div>", r = e.innerHTML.toLowerCase(), n = r === "<p></p><div></div>" || r === "<p><div></div></p>", this.autoClosesUnclosedTags = function () {
                return n
            }, n
        },
        supportsNativeGetElementsByClassName: function () {
            return String(document.getElementsByClassName).indexOf("[native code]") !== -1
        },
        supportsSelectionModify: function () {
            return "getSelection" in window && "modify" in window.getSelection()
        },
        supportsClassList: function () {
            return "classList" in t
        },
        needsSpaceAfterLineBreak: function () {
            return o
        },
        supportsSpeechApiOn: function (t) {
            var n = e.match(/Chrome\/(\d+)/) || [, 0];
            return n[1] >= 11 && ("onwebkitspeechchange" in t || "speech" in t)
        },
        crashesWhenDefineProperty: function (e) {
            return n && (e === "XMLHttpRequest" || e === "XDomainRequest")
        },
        doesAsyncFocus: function () {
            return n
        },
        hasProblemsSettingCaretAfterImg: function () {
            return n
        },
        hasUndoInContextMenu: function () {
            return r || s || o
        }
    }
}(), wysihtml5.lang.array = function (e) {
    return {
        contains: function (t) {
            if (e.indexOf) return e.indexOf(t) !== -1;
            for (var n = 0, r = e.length; n < r; n++)
                if (e[n] === t) return !0;
            return !1
        },
        without: function (t) {
            t = wysihtml5.lang.array(t);
            var n = [],
                r = 0,
                i = e.length;
            for (; r < i; r++) t.contains(e[r]) || n.push(e[r]);
            return n
        },
        get: function () {
            var t = 0,
                n = e.length,
                r = [];
            for (; t < n; t++) r.push(e[t]);
            return r
        }
    }
}, wysihtml5.lang.Dispatcher = Base.extend({
    observe: function (e, t) {
        return this.events = this.events || {}, this.events[e] = this.events[e] || [], this.events[e].push(t), this
    },
    on: function () {
        return this.observe.apply(this, wysihtml5.lang.array(arguments).get())
    },
    fire: function (e, t) {
        this.events = this.events || {};
        var n = this.events[e] || [],
            r = 0;
        for (; r < n.length; r++) n[r].call(this, t);
        return this
    },
    stopObserving: function (e, t) {
        this.events = this.events || {};
        var n = 0,
            r, i;
        if (e) {
            r = this.events[e] || [], i = [];
            for (; n < r.length; n++) r[n] !== t && t && i.push(r[n]);
            this.events[e] = i
        } else this.events = {};
        return this
    }
}), wysihtml5.lang.object = function (e) {
    return {
        merge: function (t) {
            for (var n in t) e[n] = t[n];
            return this
        },
        get: function () {
            return e
        },
        clone: function () {
            var t = {}, n;
            for (n in e) t[n] = e[n];
            return t
        },
        isArray: function () {
            return Object.prototype.toString.call(e) === "[object Array]"
        }
    }
},
function () {
    var e = /^\s+/,
        t = /\s+$/;
    wysihtml5.lang.string = function (n) {
        return n = String(n), {
            trim: function () {
                return n.replace(e, "").replace(t, "")
            },
            interpolate: function (e) {
                for (var t in e) n = this.replace("#{" + t + "}").by(e[t]);
                return n
            },
            replace: function (e) {
                return {
                    by: function (t) {
                        return n.split(e).join(t)
                    }
                }
            }
        }
    }
}(),
function (e) {
    function o(e) {
        return l(e) ? e : (e === e.ownerDocument.documentElement && (e = e.ownerDocument.body), c(e))
    }

    function u(e) {
        return e.replace(n, function (e, t) {
            var n = (t.match(r) || [])[1] || "",
                o = s[n];
            t = t.replace(r, ""), t.split(o).length > t.split(n).length && (t += n, n = "");
            var u = t,
                a = t;
            return t.length > i && (a = a.substr(0, i) + "..."), u.substr(0, 4) === "www." && (u = "http://" + u), '<a href="' + u + '">' + a + "</a>" + n
        })
    }

    function a(e) {
        var t = e._wysihtml5_tempElement;
        return t || (t = e._wysihtml5_tempElement = e.createElement("div")), t
    }

    function f(e) {
        var t = e.parentNode,
            n = a(t.ownerDocument);
        n.innerHTML = "<span></span>" + u(e.data), n.removeChild(n.firstChild);
        while (n.firstChild) t.insertBefore(n.firstChild, e);
        t.removeChild(e)
    }

    function l(e) {
        var n;
        while (e.parentNode) {
            e = e.parentNode, n = e.nodeName;
            if (t.contains(n)) return !0;
            if (n === "body") return !1
        }
        return !1
    }

    function c(r) {
        if (t.contains(r.nodeName)) return;
        if (r.nodeType === e.TEXT_NODE && r.data.match(n)) {
            f(r);
            return
        }
        var i = e.lang.array(r.childNodes).get(),
            s = i.length,
            o = 0;
        for (; o < s; o++) c(i[o]);
        return r
    }
    var t = e.lang.array(["CODE", "PRE", "A", "SCRIPT", "HEAD", "TITLE", "STYLE"]),
        n = /((https?:\/\/|www\.)[^\s<]{3,})/gi,
        r = /([^\w\/\-](,?))$/i,
        i = 100,
        s = {
            ")": "(",
            "]": "[",
            "}": "{"
        };
    e.dom.autoLink = o, e.dom.autoLink.URL_REG_EXP = n
}(wysihtml5),
function (e) {
    var t = e.browser.supportsClassList(),
        n = e.dom;
    n.addClass = function (e, r) {
        if (t) return e.classList.add(r);
        if (n.hasClass(e, r)) return;
        e.className += " " + r
    }, n.removeClass = function (e, n) {
        if (t) return e.classList.remove(n);
        e.className = e.className.replace(new RegExp("(^|\\s+)" + n + "(\\s+|$)"), " ")
    }, n.hasClass = function (e, n) {
        if (t) return e.classList.contains(n);
        var r = e.className;
        return r.length > 0 && (r == n || (new RegExp("(^|\\s)" + n + "(\\s|$)")).test(r))
    }
}(wysihtml5), wysihtml5.dom.contains = function () {
    var e = document.documentElement;
    if (e.contains) return function (e, t) {
        return t.nodeType !== wysihtml5.ELEMENT_NODE && (t = t.parentNode), e !== t && e.contains(t)
    };
    if (e.compareDocumentPosition) return function (e, t) {
        return !!(e.compareDocumentPosition(t) & 16)
    }
}(), wysihtml5.dom.convertToList = function () {
    function e(e, t) {
        var n = e.createElement("li");
        return t.appendChild(n), n
    }

    function t(e, t) {
        return e.createElement(t)
    }

    function n(n, r) {
        if (n.nodeName === "UL" || n.nodeName === "OL" || n.nodeName === "MENU") return n;
        var i = n.ownerDocument,
            s = t(i, r),
            o = n.querySelectorAll("br"),
            u = o.length,
            a, f, l, c, h, p, d, v, m;
        for (m = 0; m < u; m++) {
            c = o[m];
            while ((h = c.parentNode) && h !== n && h.lastChild === c) {
                if (wysihtml5.dom.getStyle("display").from(h) === "block") {
                    h.removeChild(c);
                    break
                }
                wysihtml5.dom.insert(c).after(c.parentNode)
            }
        }
        a = wysihtml5.lang.array(n.childNodes).get(), f = a.length;
        for (m = 0; m < f; m++) {
            v = v || e(i, s), l = a[m], p = wysihtml5.dom.getStyle("display").from(l) === "block", d = l.nodeName === "BR";
            if (p) {
                v = v.firstChild ? e(i, s) : v, v.appendChild(l), v = null;
                continue
            }
            if (d) {
                v = v.firstChild ? null : v;
                continue
            }
            v.appendChild(l)
        }
        return n.parentNode.replaceChild(s, n), s
    }
    return n
}(), wysihtml5.dom.copyAttributes = function (e) {
    return {
        from: function (t) {
            return {
                to: function (n) {
                    var r, i = 0,
                        s = e.length;
                    for (; i < s; i++) r = e[i], typeof t[r] != "undefined" && t[r] !== "" && (n[r] = t[r]);
                    return {
                        andTo: arguments.callee
                    }
                }
            }
        }
    }
},
function (e) {
    var t = ["-webkit-box-sizing", "-moz-box-sizing", "-ms-box-sizing", "box-sizing"],
        n = function (t) {
            return r(t) ? parseInt(e.getStyle("width").from(t), 10) < t.offsetWidth : !1
        }, r = function (n) {
            var r = 0,
                i = t.length;
            for (; r < i; r++)
                if (e.getStyle(t[r]).from(n) === "border-box") return t[r]
        };
    e.copyStyles = function (r) {
        return {
            from: function (i) {
                n(i) && (r = wysihtml5.lang.array(r).without(t));
                var s = "",
                    o = r.length,
                    u = 0,
                    a;
                for (; u < o; u++) a = r[u], s += a + ":" + e.getStyle(a).from(i) + ";";
                return {
                    to: function (t) {
                        return e.setStyles(s).on(t), {
                            andTo: arguments.callee
                        }
                    }
                }
            }
        }
    }
}(wysihtml5.dom),
function (e) {
    e.dom.delegate = function (t, n, r, i) {
        return e.dom.observe(t, r, function (r) {
            var s = r.target,
                o = e.lang.array(t.querySelectorAll(n));
            while (s && s !== t) {
                if (o.contains(s)) {
                    i.call(s, r);
                    break
                }
                s = s.parentNode
            }
        })
    }
}(wysihtml5), wysihtml5.dom.getAsDom = function () {
    var e = function (e, t) {
        var n = t.createElement("div");
        n.style.display = "none", t.body.appendChild(n);
        try {
            n.innerHTML = e
        } catch (r) {}
        return t.body.removeChild(n), n
    }, t = function (e) {
            if (e._wysihtml5_supportsHTML5Tags) return;
            for (var t = 0, r = n.length; t < r; t++) e.createElement(n[t]);
            e._wysihtml5_supportsHTML5Tags = !0
        }, n = ["abbr", "article", "aside", "audio", "bdi", "canvas", "command", "datalist", "details", "figcaption", "figure", "footer", "header", "hgroup", "keygen", "mark", "meter", "nav", "output", "progress", "rp", "rt", "ruby", "svg", "section", "source", "summary", "time", "track", "video", "wbr"];
    return function (n, r) {
        r = r || document;
        var i;
        return typeof n == "object" && n.nodeType ? (i = r.createElement("div"), i.appendChild(n)) : wysihtml5.browser.supportsHTML5Tags(r) ? (i = r.createElement("div"), i.innerHTML = n) : (t(r), i = e(n, r)), i
    }
}(), wysihtml5.dom.getParentElement = function () {
    function e(e, t) {
        return !t || !t.length ? !0 : typeof t == "string" ? e === t : wysihtml5.lang.array(t).contains(e)
    }

    function t(e) {
        return e.nodeType === wysihtml5.ELEMENT_NODE
    }

    function n(e, t, n) {
        var r = (e.className || "").match(n) || [];
        return t ? r[r.length - 1] === t : !! r.length
    }

    function r(t, n, r) {
        while (r-- && t && t.nodeName !== "BODY") {
            if (e(t.nodeName, n)) return t;
            t = t.parentNode
        }
        return null
    }

    function i(r, i, s, o, u) {
        while (u-- && r && r.nodeName !== "BODY") {
            if (t(r) && e(r.nodeName, i) && n(r, s, o)) return r;
            r = r.parentNode
        }
        return null
    }
    return function (e, t, n) {
        return n = n || 50, t.className || t.classRegExp ? i(e, t.nodeName, t.className, t.classRegExp, n) : r(e, t.nodeName, n)
    }
}(), wysihtml5.dom.getStyle = function () {
    function n(e) {
        return e.replace(t, function (e) {
            return e.charAt(1).toUpperCase()
        })
    }
    var e = {
        "float": "styleFloat" in document.createElement("div").style ? "styleFloat" : "cssFloat"
    }, t = /\-[a-z]/g;
    return function (t) {
        return {
            from: function (r) {
                if (r.nodeType !== wysihtml5.ELEMENT_NODE) return;
                var i = r.ownerDocument,
                    s = e[t] || n(t),
                    o = r.style,
                    u = r.currentStyle,
                    a = o[s];
                if (a) return a;
                if (u) try {
                    return u[s]
                } catch (f) {}
                var l = i.defaultView || i.parentWindow,
                    c = (t === "height" || t === "width") && r.nodeName === "TEXTAREA",
                    h, p;
                if (l.getComputedStyle) return c && (h = o.overflow, o.overflow = "hidden"), p = l.getComputedStyle(r, null).getPropertyValue(t), c && (o.overflow = h || ""), p
            }
        }
    }
}(), wysihtml5.dom.hasElementWithTagName = function () {
    function n(e) {
        return e._wysihtml5_identifier || (e._wysihtml5_identifier = t++)
    }
    var e = {}, t = 1;
    return function (t, r) {
        var i = n(t) + ":" + r,
            s = e[i];
        return s || (s = e[i] = t.getElementsByTagName(r)), s.length > 0
    }
}(),
function (e) {
    function r(e) {
        return e._wysihtml5_identifier || (e._wysihtml5_identifier = n++)
    }
    var t = {}, n = 1;
    e.dom.hasElementWithClassName = function (n, i) {
        if (!e.browser.supportsNativeGetElementsByClassName()) return !!n.querySelector("." + i);
        var s = r(n) + ":" + i,
            o = t[s];
        return o || (o = t[s] = n.getElementsByClassName(i)), o.length > 0
    }
}(wysihtml5), wysihtml5.dom.insert = function (e) {
    return {
        after: function (t) {
            t.parentNode.insertBefore(e, t.nextSibling)
        },
        before: function (t) {
            t.parentNode.insertBefore(e, t)
        },
        into: function (t) {
            t.appendChild(e)
        }
    }
}, wysihtml5.dom.insertCSS = function (e) {
    return e = e.join("\n"), {
        into: function (t) {
            var n = t.head || t.getElementsByTagName("head")[0],
                r = t.createElement("style");
            r.type = "text/css", r.styleSheet ? r.styleSheet.cssText = e : r.appendChild(t.createTextNode(e)), n && n.appendChild(r)
        }
    }
}, wysihtml5.dom.observe = function (e, t, n) {
    t = typeof t == "string" ? [t] : t;
    var r, i, s = 0,
        o = t.length;
    for (; s < o; s++) i = t[s], e.addEventListener ? e.addEventListener(i, n, !1) : (r = function (t) {
        "target" in t || (t.target = t.srcElement), t.preventDefault = t.preventDefault || function () {
            this.returnValue = !1
        }, t.stopPropagation = t.stopPropagation || function () {
            this.cancelBubble = !0
        }, n.call(e, t)
    }, e.attachEvent("on" + i, r));
    return {
        stop: function () {
            var i, s = 0,
                o = t.length;
            for (; s < o; s++) i = t[s], e.removeEventListener ? e.removeEventListener(i, n, !1) : e.detachEvent("on" + i, r)
        }
    }
}, wysihtml5.dom.parse = function () {
    function s(e, t, n, s) {
        wysihtml5.lang.object(i).merge(r).merge(t).get(), n = n || e.ownerDocument || document;
        var u = n.createDocumentFragment(),
            a = typeof e == "string",
            f, l, c;
        a ? f = wysihtml5.dom.getAsDom(e, n) : f = e;
        while (f.firstChild) c = f.firstChild, f.removeChild(c), l = o(c, s), l && u.appendChild(l);
        return f.innerHTML = "", f.appendChild(u), a ? wysihtml5.quirks.getCorrectInnerHTML(f) : f
    }

    function o(n, r) {
        var i = n.nodeType,
            s = n.childNodes,
            u = s.length,
            a, f = e[i],
            l = 0;
        a = f && f(n);
        if (!a) return null;
        for (l = 0; l < u; l++) newChild = o(s[l], r), newChild && a.appendChild(newChild);
        return r && a.childNodes.length <= 1 && a.nodeName.toLowerCase() === t && !a.attributes.length ? a.firstChild : a
    }

    function u(e) {
        var n, r, s, o = i.tags,
            u = e.nodeName.toLowerCase(),
            f = e.scopeName;
        if (e._wysihtml5) return null;
        e._wysihtml5 = 1;
        if (e.className === "wysihtml5-temp") return null;
        f && f != "HTML" && (u = f + ":" + u), "outerHTML" in e && !wysihtml5.browser.autoClosesUnclosedTags() && e.nodeName === "P" && e.outerHTML.slice(-4).toLowerCase() !== "</p>" && (u = "div");
        if (u in o) {
            n = o[u];
            if (!n || n.remove) return null;
            n = typeof n == "string" ? {
                rename_tag: n
            } : n
        } else {
            if (!e.firstChild) return null;
            n = {
                rename_tag: t
            }
        }
        return r = e.ownerDocument.createElement(n.rename_tag || u), a(e, r, n), e = null, r
    }

    function a(e, t, r) {
        var s = {}, o = r.set_class,
            u = r.add_class,
            a = r.set_attributes,
            f = r.check_attributes,
            c = i.classes,
            h = 0,
            v = [],
            m = [],
            g = [],
            y = [],
            b, w, E, S, x, T, N;
        a && (s = wysihtml5.lang.object(a).clone());
        if (f)
            for (x in f) {
                N = p[f[x]];
                if (!N) continue;
                T = N(l(e, x)), typeof T == "string" && (s[x] = T)
            }
        o && v.push(o);
        if (u)
            for (x in u) {
                N = d[u[x]];
                if (!N) continue;
                S = N(l(e, x)), typeof S == "string" && v.push(S)
            }
        c["_wysihtml5-temp-placeholder"] = 1, y = e.getAttribute("class"), y && (v = v.concat(y.split(n))), b = v.length;
        for (; h < b; h++) E = v[h], c[E] && m.push(E);
        w = m.length;
        while (w--) E = m[w], wysihtml5.lang.array(g).contains(E) || g.unshift(E);
        g.length && (s["class"] = g.join(" "));
        for (x in s) try {
            t.setAttribute(x, s[x])
        } catch (C) {}
        s.src && (typeof s.width != "undefined" && t.setAttribute("width", s.width), typeof s.height != "undefined" && t.setAttribute("height", s.height))
    }

    function l(e, t) {
        t = t.toLowerCase();
        var n = e.nodeName;
        if (n == "IMG" && t == "src" && c(e) === !0) return e.src;
        if (f && "outerHTML" in e) {
            var r = e.outerHTML.toLowerCase(),
                i = r.indexOf(" " + t + "=") != -1;
            return i ? e.getAttribute(t) : null
        }
        return e.getAttribute(t)
    }

    function c(e) {
        try {
            return e.complete && !e.mozMatchesSelector(":-moz-broken")
        } catch (t) {
            if (e.complete && e.readyState === "complete") return !0
        }
    }

    function h(e) {
        return e.ownerDocument.createTextNode(e.data)
    }
    var e = {
        1: u,
        3: h
    }, t = "span",
        n = /\s+/,
        r = {
            tags: {},
            classes: {}
        }, i = {}, f = !wysihtml5.browser.supportsGetAttributeCorrectly(),
        p = {
            url: function () {
                var e = /^https?:\/\//i;
                return function (t) {
                    return !t || !t.match(e) ? null : t.replace(e, function (e) {
                        return e.toLowerCase()
                    })
                }
            }(),
            alt: function () {
                var e = /[^ a-z0-9_\-]/gi;
                return function (t) {
                    return t ? t.replace(e, "") : ""
                }
            }(),
            numbers: function () {
                var e = /\D/g;
                return function (t) {
                    return t = (t || "").replace(e, ""), t || null
                }
            }()
        }, d = {
            align_img: function () {
                var e = {
                    left: "wysiwyg-float-left",
                    right: "wysiwyg-float-right"
                };
                return function (t) {
                    return e[String(t).toLowerCase()]
                }
            }(),
            align_text: function () {
                var e = {
                    left: "wysiwyg-text-align-left",
                    right: "wysiwyg-text-align-right",
                    center: "wysiwyg-text-align-center",
                    justify: "wysiwyg-text-align-justify"
                };
                return function (t) {
                    return e[String(t).toLowerCase()]
                }
            }(),
            clear_br: function () {
                var e = {
                    left: "wysiwyg-clear-left",
                    right: "wysiwyg-clear-right",
                    both: "wysiwyg-clear-both",
                    all: "wysiwyg-clear-both"
                };
                return function (t) {
                    return e[String(t).toLowerCase()]
                }
            }(),
            size_font: function () {
                var e = {
                    1: "wysiwyg-font-size-xx-small",
                    2: "wysiwyg-font-size-small",
                    3: "wysiwyg-font-size-medium",
                    4: "wysiwyg-font-size-large",
                    5: "wysiwyg-font-size-x-large",
                    6: "wysiwyg-font-size-xx-large",
                    7: "wysiwyg-font-size-xx-large",
                    "-": "wysiwyg-font-size-smaller",
                    "+": "wysiwyg-font-size-larger"
                };
                return function (t) {
                    return e[String(t).charAt(0)]
                }
            }()
        };
    return s
}(), wysihtml5.dom.removeEmptyTextNodes = function (e) {
    var t, n = wysihtml5.lang.array(e.childNodes).get(),
        r = n.length,
        i = 0;
    for (; i < r; i++) t = n[i], t.nodeType === wysihtml5.TEXT_NODE && t.data === "" && t.parentNode.removeChild(t)
}, wysihtml5.dom.renameElement = function (e, t) {
    var n = e.ownerDocument.createElement(t),
        r;
    while (r = e.firstChild) n.appendChild(r);
    return wysihtml5.dom.copyAttributes(["align", "className"]).from(e).to(n), e.parentNode.replaceChild(n, e), n
}, wysihtml5.dom.replaceWithChildNodes = function (e) {
    if (!e.parentNode) return;
    if (!e.firstChild) {
        e.parentNode.removeChild(e);
        return
    }
    var t = e.ownerDocument.createDocumentFragment();
    while (e.firstChild) t.appendChild(e.firstChild);
    e.parentNode.replaceChild(t, e), e = t = null
},
function (e) {
    function t(t) {
        return e.getStyle("display").from(t) === "block"
    }

    function n(e) {
        return e.nodeName === "BR"
    }

    function r(e) {
        var t = e.ownerDocument.createElement("br");
        e.appendChild(t)
    }

    function i(e) {
        if (e.nodeName !== "MENU" && e.nodeName !== "UL" && e.nodeName !== "OL") return;
        var i = e.ownerDocument,
            s = i.createDocumentFragment(),
            o = e.previousElementSibling || e.previousSibling,
            u, a, f, l, c;
        o && !t(o) && r(s);
        while (c = e.firstChild) {
            a = c.lastChild;
            while (u = c.firstChild) f = u === a, l = f && !t(u) && !n(u), s.appendChild(u), l && r(s);
            c.parentNode.removeChild(c)
        }
        e.parentNode.replaceChild(s, e)
    }
    e.resolveList = i
}(wysihtml5.dom),
function (e) {
    var t = document,
        n = ["parent", "top", "opener", "frameElement", "frames", "localStorage", "globalStorage", "sessionStorage", "indexedDB"],
        r = ["open", "close", "openDialog", "showModalDialog", "alert", "confirm", "prompt", "openDatabase", "postMessage", "XMLHttpRequest", "XDomainRequest"],
        i = ["referrer", "write", "open", "close"];
    e.dom.Sandbox = Base.extend({
        constructor: function (t, n) {
            this.callback = t || e.EMPTY_FUNCTION, this.config = e.lang.object({}).merge(n).get(), this.iframe = this._createIframe()
        },
        insertInto: function (e) {
            typeof e == "string" && (e = t.getElementById(e)), e.appendChild(this.iframe)
        },
        getIframe: function () {
            return this.iframe
        },
        getWindow: function () {
            this._readyError()
        },
        getDocument: function () {
            this._readyError()
        },
        destroy: function () {
            var e = this.getIframe();
            e.parentNode.removeChild(e)
        },
        _readyError: function () {
            throw new Error("wysihtml5.Sandbox: Sandbox iframe isn't loaded yet")
        },
        _createIframe: function () {
            var n = this,
                r = t.createElement("iframe");
            return r.className = "wysihtml5-sandbox", e.dom.setAttributes({
                security: "restricted",
                allowtransparency: "true",
                frameborder: 0,
                width: 0,
                height: 0,
                marginwidth: 0,
                marginheight: 0
            }).on(r), e.browser.throwsMixedContentWarningWhenIframeSrcIsEmpty() && (r.src = "javascript:'<html></html>'"), r.onload = function () {
                r.onreadystatechange = r.onload = null, n._onLoadIframe(r)
            }, r.onreadystatechange = function () {
                /loaded|complete/.test(r.readyState) && (r.onreadystatechange = r.onload = null, n._onLoadIframe(r))
            }, r
        },
        _onLoadIframe: function (s) {
            if (!e.dom.contains(t.documentElement, s)) return;
            var o = this,
                u = s.contentWindow,
                a = s.contentWindow.document,
                f = t.characterSet || t.charset || "utf-8",
                l = this._getHtml({
                    charset: f,
                    stylesheets: this.config.stylesheets
                });
            a.open("text/html", "replace"), a.write(l), a.close(), this.getWindow = function () {
                return s.contentWindow
            }, this.getDocument = function () {
                return s.contentWindow.document
            }, u.onerror = function (e, t, n) {
                throw new Error("wysihtml5.Sandbox: " + e, t, n)
            };
            if (!e.browser.supportsSandboxedIframes()) {
                var c, h;
                for (c = 0, h = n.length; c < h; c++) this._unset(u, n[c]);
                for (c = 0, h = r.length; c < h; c++) this._unset(u, r[c], e.EMPTY_FUNCTION);
                for (c = 0, h = i.length; c < h; c++) this._unset(a, i[c]);
                this._unset(a, "cookie", "", !0)
            }
            this.loaded = !0, setTimeout(function () {
                o.callback(o)
            }, 0)
        },
        _getHtml: function (t) {
            var n = t.stylesheets,
                r = "",
                i = 0,
                s;
            n = typeof n == "string" ? [n] : n;
            if (n) {
                s = n.length;
                for (; i < s; i++) r += '<link rel="stylesheet" href="' + n[i] + '">'
            }
            return t.stylesheets = r, e.lang.string('<!DOCTYPE html><html><head><meta charset="#{charset}">#{stylesheets}</head><body></body></html>').interpolate(t)
        },
        _unset: function (t, n, r, i) {
            try {
                t[n] = r
            } catch (s) {}
            try {
                t.__defineGetter__(n, function () {
                    return r
                })
            } catch (s) {}
            if (i) try {
                t.__defineSetter__(n, function () {})
            } catch (s) {}
            if (!e.browser.crashesWhenDefineProperty(n)) try {
                var o = {
                    get: function () {
                        return r
                    }
                };
                i && (o.set = function () {}), Object.defineProperty(t, n, o)
            } catch (s) {}
        }
    })
}(wysihtml5),
function () {
    var e = {
        className: "class"
    };
    wysihtml5.dom.setAttributes = function (t) {
        return {
            on: function (n) {
                for (var r in t) n.setAttribute(e[r] || r, t[r])
            }
        }
    }
}(), wysihtml5.dom.setStyles = function (e) {
    return {
        on: function (t) {
            var n = t.style;
            if (typeof e == "string") {
                n.cssText += ";" + e;
                return
            }
            for (var r in e) r === "float" ? (n.cssFloat = e[r], n.styleFloat = e[r]) : n[r] = e[r]
        }
    }
},
function (e) {
    e.simulatePlaceholder = function (t, n, r) {
        var i = "placeholder",
            s = function () {
                n.hasPlaceholderSet() && n.clear(), e.removeClass(n.element, i)
            }, o = function () {
                n.isEmpty() && (n.setValue(r), e.addClass(n.element, i))
            };
        t.observe("set_placeholder", o).observe("unset_placeholder", s).observe("focus:composer", s).observe("paste:composer", s).observe("blur:composer", o), o()
    }
}(wysihtml5.dom),
function (e) {
    var t = document.documentElement;
    "textContent" in t ? (e.setTextContent = function (e, t) {
        e.textContent = t
    }, e.getTextContent = function (e) {
        return e.textContent
    }) : "innerText" in t ? (e.setTextContent = function (e, t) {
        e.innerText = t
    }, e.getTextContent = function (e) {
        return e.innerText
    }) : (e.setTextContent = function (e, t) {
        e.nodeValue = t
    }, e.getTextContent = function (e) {
        return e.nodeValue
    })
}(wysihtml5.dom), wysihtml5.quirks.cleanPastedHTML = function () {
    function t(t, n, r) {
        n = n || e, r = r || t.ownerDocument || document;
        var i, s = typeof t == "string",
            o, u, a, f, l = 0;
        s ? i = wysihtml5.dom.getAsDom(t, r) : i = t;
        for (f in n) {
            u = i.querySelectorAll(f), o = n[f], a = u.length;
            for (; l < a; l++) o(u[l])
        }
        return u = t = n = null, s ? i.innerHTML : i
    }
    var e = {
        "a u": wysihtml5.dom.replaceWithChildNodes
    };
    return t
}(),
function (e) {
    var t = e.dom;
    e.quirks.ensureProperClearing = function () {
        var e = function (e) {
            var t = this;
            setTimeout(function () {
                var e = t.innerHTML.toLowerCase();
                if (e == "<p>&nbsp;</p>" || e == "<p>&nbsp;</p><p>&nbsp;</p>") t.innerHTML = ""
            }, 0)
        };
        return function (n) {
            t.observe(n.element, ["cut", "keydown"], e)
        }
    }(), e.quirks.ensureProperClearingOfLists = function () {
        var n = ["OL", "UL", "MENU"],
            r = function (r, i) {
                if (!i.firstChild || !e.lang.array(n).contains(i.firstChild.nodeName)) return;
                var s = t.getParentElement(r, {
                    nodeName: n
                });
                if (!s) return;
                var o = s == i.firstChild;
                if (!o) return;
                var u = s.childNodes.length <= 1;
                if (!u) return;
                var a = s.firstChild ? s.firstChild.innerHTML === "" : !0;
                if (!a) return;
                s.parentNode.removeChild(s)
            };
        return function (n) {
            t.observe(n.element, "keydown", function (t) {
                if (t.keyCode !== e.BACKSPACE_KEY) return;
                var i = n.selection.getSelectedNode();
                r(i, n.element)
            })
        }
    }()
}(wysihtml5),
function (e) {
    var t = "%7E";
    e.quirks.getCorrectInnerHTML = function (n) {
        var r = n.innerHTML;
        if (r.indexOf(t) === -1) return r;
        var i = n.querySelectorAll("[href*='~'], [src*='~']"),
            s, o, u, a;
        for (a = 0, u = i.length; a < u; a++) s = i[a].href || i[a].src, o = e.lang.string(s).replace("~").by(t), r = e.lang.string(r).replace(o).by(s);
        return r
    }
}(wysihtml5),
function (e) {
    var t = e.dom,
        n = ["LI", "P", "H1", "H2", "H3", "H4", "H5", "H6"],
        r = ["UL", "OL", "MENU"];
    e.quirks.insertLineBreakOnReturn = function (i) {
        function s(n) {
            var r = t.getParentElement(n, {
                nodeName: ["P", "DIV"]
            }, 2);
            if (!r) return;
            var s = document.createTextNode(e.INVISIBLE_SPACE);
            t.insert(s).before(r), t.replaceWithChildNodes(r), i.selection.selectNode(s)
        }

        function o(o) {
            var u = o.keyCode;
            if (o.shiftKey || u !== e.ENTER_KEY && u !== e.BACKSPACE_KEY) return;
            var a = o.target,
                f = i.selection.getSelectedNode(),
                l = t.getParentElement(f, {
                    nodeName: n
                }, 4);
            if (l) {
                l.nodeName !== "LI" || u !== e.ENTER_KEY && u !== e.BACKSPACE_KEY ? l.nodeName.match(/H[1-6]/) && u === e.ENTER_KEY && setTimeout(function () {
                    s(i.selection.getSelectedNode())
                }, 0) : setTimeout(function () {
                    var e = i.selection.getSelectedNode(),
                        n, o;
                    if (!e) return;
                    n = t.getParentElement(e, {
                        nodeName: r
                    }, 2);
                    if (n) return;
                    s(e)
                }, 0);
                return
            }
            u === e.ENTER_KEY && !e.browser.insertsLineBreaksOnReturn() && (i.commands.exec("insertLineBreak"), o.preventDefault())
        }
        t.observe(i.element.ownerDocument, "keydown", o)
    }
}(wysihtml5),
function (e) {
    var t = "wysihtml5-quirks-redraw";
    e.quirks.redraw = function (n) {
        e.dom.addClass(n, t), e.dom.removeClass(n, t);
        try {
            var r = n.ownerDocument;
            r.execCommand("italic", !1, null), r.execCommand("italic", !1, null)
        } catch (i) {}
    }
}(wysihtml5),
function (e) {
    function n(e) {
        var t = 0;
        if (e.parentNode)
            do t += e.offsetTop || 0, e = e.offsetParent; while (e);
        return t
    }
    var t = e.dom;
    e.Selection = Base.extend({
        constructor: function (e) {
            window.rangy.init(), this.editor = e, this.composer = e.composer, this.doc = this.composer.doc
        },
        getBookmark: function () {
            var e = this.getRange();
            return e && e.cloneRange()
        },
        setBookmark: function (e) {
            if (!e) return;
            this.setSelection(e)
        },
        setBefore: function (e) {
            var t = rangy.createRange(this.doc);
            return t.setStartBefore(e), t.setEndBefore(e), this.setSelection(t)
        },
        setAfter: function (e) {
            var t = rangy.createRange(this.doc);
            return t.setStartAfter(e), t.setEndAfter(e), this.setSelection(t)
        },
        selectNode: function (n) {
            var r = rangy.createRange(this.doc),
                i = n.nodeType === e.ELEMENT_NODE,
                s = "canHaveHTML" in n ? n.canHaveHTML : n.nodeName !== "IMG",
                o = i ? n.innerHTML : n.data,
                u = o === "" || o === e.INVISIBLE_SPACE,
                a = t.getStyle("display").from(n),
                f = a === "block" || a === "list-item";
            if (u && i && s) try {
                n.innerHTML = e.INVISIBLE_SPACE
            } catch (l) {}
            s ? r.selectNodeContents(n) : r.selectNode(n), s && u && i ? r.collapse(f) : s && u && (r.setStartAfter(n), r.setEndAfter(n)), this.setSelection(r)
        },
        getSelectedNode: function (e) {
            var t, n;
            if (e && this.doc.selection && this.doc.selection.type === "Control") {
                n = this.doc.selection.createRange();
                if (n && n.length) return n.item(0)
            }
            return t = this.getSelection(this.doc), t.focusNode === t.anchorNode ? t.focusNode : (n = this.getRange(this.doc), n ? n.commonAncestorContainer : this.doc.body)
        },
        executeAndRestore: function (t, n) {
            var r = this.doc.body,
                i = n && r.scrollTop,
                s = n && r.scrollLeft,
                o = "_wysihtml5-temp-placeholder",
                u = '<span class="' + o + '">' + e.INVISIBLE_SPACE + "</span>",
                a = this.getRange(this.doc),
                f;
            if (!a) {
                t(r, r);
                return
            }
            var l = a.createContextualFragment(u);
            a.insertNode(l);
            try {
                t(a.startContainer, a.endContainer)
            } catch (c) {
                setTimeout(function () {
                    throw c
                }, 0)
            }
            caretPlaceholder = this.doc.querySelector("." + o), caretPlaceholder ? (f = rangy.createRange(this.doc), f.selectNode(caretPlaceholder), f.deleteContents(), this.setSelection(f)) : r.focus(), n && (r.scrollTop = i, r.scrollLeft = s);
            try {
                caretPlaceholder.parentNode.removeChild(caretPlaceholder)
            } catch (h) {}
        },
        executeAndRestoreSimple: function (e) {
            var t = this.getRange(),
                n = this.doc.body,
                r, i, s, o, u;
            if (!t) {
                e(n, n);
                return
            }
            o = t.getNodes([3]), i = o[0] || t.startContainer, s = o[o.length - 1] || t.endContainer, u = {
                collapsed: t.collapsed,
                startContainer: i,
                startOffset: i === t.startContainer ? t.startOffset : 0,
                endContainer: s,
                endOffset: s === t.endContainer ? t.endOffset : s.length
            };
            try {
                e(t.startContainer, t.endContainer)
            } catch (a) {
                setTimeout(function () {
                    throw a
                }, 0)
            }
            r = rangy.createRange(this.doc);
            try {
                r.setStart(u.startContainer, u.startOffset)
            } catch (f) {}
            try {
                r.setEnd(u.endContainer, u.endOffset)
            } catch (l) {}
            try {
                this.setSelection(r)
            } catch (c) {}
        },
        insertHTML: function (e) {
            var t = rangy.createRange(this.doc),
                n = t.createContextualFragment(e),
                r = n.lastChild;
            this.insertNode(n), r && this.setAfter(r)
        },
        insertNode: function (e) {
            var t = this.getRange();
            t && t.insertNode(e)
        },
        surround: function (e) {
            var t = this.getRange();
            if (!t) return;
            try {
                t.surroundContents(e), this.selectNode(e)
            } catch (n) {
                e.appendChild(t.extractContents()), t.insertNode(e)
            }
        },
        scrollIntoView: function () {
            var t = this.doc,
                r = t.documentElement.scrollHeight > t.documentElement.offsetHeight,
                i = t._wysihtml5ScrollIntoViewElement = t._wysihtml5ScrollIntoViewElement || function () {
                    var n = t.createElement("span");
                    return n.innerHTML = e.INVISIBLE_SPACE, n
                }(),
                s;
            r && (this.insertNode(i), s = n(i), i.parentNode.removeChild(i), s > t.body.scrollTop && (t.body.scrollTop = s))
        },
        selectLine: function () {
            e.browser.supportsSelectionModify() ? this._selectLine_W3C() : this.doc.selection && this._selectLine_MSIE()
        },
        _selectLine_W3C: function () {
            var e = this.doc.defaultView,
                t = e.getSelection();
            t.modify("extend", "left", "lineboundary"), t.modify("extend", "right", "lineboundary")
        },
        _selectLine_MSIE: function () {
            var e = this.doc.selection.createRange(),
                t = e.boundingTop,
                n = e.boundingHeight,
                r = this.doc.body.scrollWidth,
                i, s, o, u, a;
            if (!e.moveToPoint) return;
            t === 0 && (o = this.doc.createElement("span"), this.insertNode(o), t = o.offsetTop, o.parentNode.removeChild(o)), t += 1;
            for (u = -10; u < r; u += 2) try {
                e.moveToPoint(u, t);
                break
            } catch (f) {}
            i = t, s = this.doc.selection.createRange();
            for (a = r; a >= 0; a--) try {
                s.moveToPoint(a, i);
                break
            } catch (l) {}
            e.setEndPoint("EndToEnd", s), e.select()
        },
        getText: function () {
            var e = this.getSelection();
            return e ? e.toString() : ""
        },
        getNodes: function (e, t) {
            var n = this.getRange();
            return n ? n.getNodes([e], t) : []
        },
        getRange: function () {
            var e = this.getSelection();
            return e && e.rangeCount && e.getRangeAt(0)
        },
        getSelection: function () {
            return rangy.getSelection(this.doc.defaultView || this.doc.parentWindow)
        },
        setSelection: function (e) {
            var t = this.doc.defaultView || this.doc.parentWindow,
                n = rangy.getSelection(t);
            return n.setSingleRange(e)
        }
    })
}(wysihtml5),
function (e, t) {
    function i(e, t, n) {
        if (!e.className) return !1;
        var r = e.className.match(n) || [];
        return r[r.length - 1] === t
    }

    function s(e, t, n) {
        e.className ? (o(e, n), e.className += " " + t) : e.className = t
    }

    function o(e, t) {
        e.className && (e.className = e.className.replace(t, ""))
    }

    function u(e, t) {
        return e.className.replace(r, " ") == t.className.replace(r, " ")
    }

    function a(e) {
        var t = e.parentNode;
        while (e.firstChild) t.insertBefore(e.firstChild, e);
        t.removeChild(e)
    }

    function f(e, t) {
        if (e.attributes.length != t.attributes.length) return !1;
        for (var n = 0, r = e.attributes.length, i, s, o; n < r; ++n) {
            i = e.attributes[n], o = i.name;
            if (o != "class") {
                s = t.attributes.getNamedItem(o);
                if (i.specified != s.specified) return !1;
                if (i.specified && i.nodeValue !== s.nodeValue) return !1
            }
        }
        return !0
    }

    function l(e, n) {
        return t.dom.isCharacterDataNode(e) ? n == 0 ? !! e.previousSibling : n == e.length ? !! e.nextSibling : !0 : n > 0 && n < e.childNodes.length
    }

    function c(e, n, r) {
        var i;
        t.dom.isCharacterDataNode(n) && (r == 0 ? (r = t.dom.getNodeIndex(n), n = n.parentNode) : r == n.length ? (r = t.dom.getNodeIndex(n) + 1, n = n.parentNode) : i = t.dom.splitDataNode(n, r));
        if (!i) {
            i = n.cloneNode(!1), i.id && i.removeAttribute("id");
            var s;
            while (s = n.childNodes[r]) i.appendChild(s);
            t.dom.insertAfter(i, n)
        }
        return n == e ? i : c(e, i.parentNode, t.dom.getNodeIndex(i))
    }

    function h(t) {
        this.isElementMerge = t.nodeType == e.ELEMENT_NODE, this.firstTextNode = this.isElementMerge ? t.lastChild : t, this.textNodes = [this.firstTextNode]
    }

    function p(e, t, r, i) {
        this.tagNames = e || [n], this.cssClass = t || "", this.similarClassRegExp = r, this.normalize = i, this.applyToAnyTagName = !1
    }
    var n = "span",
        r = /\s+/g;
    h.prototype = {
        doMerge: function () {
            var e = [],
                t, n, r;
            for (var i = 0, s = this.textNodes.length; i < s; ++i) t = this.textNodes[i], n = t.parentNode, e[i] = t.data, i && (n.removeChild(t), n.hasChildNodes() || n.parentNode.removeChild(n));
            return this.firstTextNode.data = r = e.join(""), r
        },
        getLength: function () {
            var e = this.textNodes.length,
                t = 0;
            while (e--) t += this.textNodes[e].length;
            return t
        },
        toString: function () {
            var e = [];
            for (var t = 0, n = this.textNodes.length; t < n; ++t) e[t] = "'" + this.textNodes[t].data + "'";
            return "[Merge(" + e.join(",") + ")]"
        }
    }, p.prototype = {
        getAncestorWithClass: function (n) {
            var r;
            while (n) {
                r = this.cssClass ? i(n, this.cssClass, this.similarClassRegExp) : !0;
                if (n.nodeType == e.ELEMENT_NODE && t.dom.arrayContains(this.tagNames, n.tagName.toLowerCase()) && r) return n;
                n = n.parentNode
            }
            return !1
        },
        postApply: function (e, t) {
            var n = e[0],
                r = e[e.length - 1],
                i = [],
                s, o = n,
                u = r,
                a = 0,
                f = r.length,
                l, c;
            for (var p = 0, d = e.length; p < d; ++p) l = e[p], c = this.getAdjacentMergeableTextNode(l.parentNode, !1), c ? (s || (s = new h(c), i.push(s)), s.textNodes.push(l), l === n && (o = s.firstTextNode, a = o.length), l === r && (u = s.firstTextNode, f = s.getLength())) : s = null;
            var v = this.getAdjacentMergeableTextNode(r.parentNode, !0);
            v && (s || (s = new h(r), i.push(s)), s.textNodes.push(v));
            if (i.length) {
                for (p = 0, d = i.length; p < d; ++p) i[p].doMerge();
                t.setStart(o, a), t.setEnd(u, f)
            }
        },
        getAdjacentMergeableTextNode: function (t, n) {
            var r = t.nodeType == e.TEXT_NODE,
                i = r ? t.parentNode : t,
                s, o = n ? "nextSibling" : "previousSibling";
            if (r) {
                s = t[o];
                if (s && s.nodeType == e.TEXT_NODE) return s
            } else {
                s = i[o];
                if (s && this.areElementsMergeable(t, s)) return s[n ? "firstChild" : "lastChild"]
            }
            return null
        },
        areElementsMergeable: function (e, n) {
            return t.dom.arrayContains(this.tagNames, (e.tagName || "").toLowerCase()) && t.dom.arrayContains(this.tagNames, (n.tagName || "").toLowerCase()) && u(e, n) && f(e, n)
        },
        createContainer: function (e) {
            var t = e.createElement(this.tagNames[0]);
            return this.cssClass && (t.className = this.cssClass), t
        },
        applyToTextNode: function (e) {
            var n = e.parentNode;
            if (n.childNodes.length == 1 && t.dom.arrayContains(this.tagNames, n.tagName.toLowerCase())) this.cssClass && s(n, this.cssClass, this.similarClassRegExp);
            else {
                var r = this.createContainer(t.dom.getDocument(e));
                e.parentNode.insertBefore(r, e), r.appendChild(e)
            }
        },
        isRemovable: function (n) {
            return t.dom.arrayContains(this.tagNames, n.tagName.toLowerCase()) && e.lang.string(n.className).trim() == this.cssClass
        },
        undoToTextNode: function (e, t, n) {
            if (!t.containsNode(n)) {
                var r = t.cloneRange();
                r.selectNode(n), r.isPointInRange(t.endContainer, t.endOffset) && l(t.endContainer, t.endOffset) && (c(n, t.endContainer, t.endOffset), t.setEndAfter(n)), r.isPointInRange(t.startContainer, t.startOffset) && l(t.startContainer, t.startOffset) && (n = c(n, t.startContainer, t.startOffset))
            }
            this.similarClassRegExp && o(n, this.similarClassRegExp), this.isRemovable(n) && a(n)
        },
        applyToRange: function (t) {
            var n = t.getNodes([e.TEXT_NODE]);
            if (!n.length) try {
                var r = this.createContainer(t.endContainer.ownerDocument);
                t.surroundContents(r), this.selectNode(t, r);
                return
            } catch (i) {}
            t.splitBoundaries(), n = t.getNodes([e.TEXT_NODE]);
            if (n.length) {
                var s;
                for (var o = 0, u = n.length; o < u; ++o) s = n[o], this.getAncestorWithClass(s) || this.applyToTextNode(s);
                t.setStart(n[0], 0), s = n[n.length - 1], t.setEnd(s, s.length), this.normalize && this.postApply(n, t)
            }
        },
        undoToRange: function (t) {
            var n = t.getNodes([e.TEXT_NODE]),
                r, i;
            if (n.length) t.splitBoundaries(), n = t.getNodes([e.TEXT_NODE]);
            else {
                var s = t.endContainer.ownerDocument,
                    o = s.createTextNode(e.INVISIBLE_SPACE);
                t.insertNode(o), t.selectNode(o), n = [o]
            }
            for (var u = 0, a = n.length; u < a; ++u) r = n[u], i = this.getAncestorWithClass(r), i && this.undoToTextNode(r, t, i);
            a == 1 ? this.selectNode(t, n[0]) : (t.setStart(n[0], 0), r = n[n.length - 1], t.setEnd(r, r.length), this.normalize && this.postApply(n, t))
        },
        selectNode: function (t, n) {
            var r = n.nodeType === e.ELEMENT_NODE,
                i = "canHaveHTML" in n ? n.canHaveHTML : !0,
                s = r ? n.innerHTML : n.data,
                o = s === "" || s === e.INVISIBLE_SPACE;
            if (o && r && i) try {
                n.innerHTML = e.INVISIBLE_SPACE
            } catch (u) {}
            t.selectNodeContents(n), o && r ? t.collapse(!1) : o && (t.setStartAfter(n), t.setEndAfter(n))
        },
        getTextSelectedByRange: function (e, t) {
            var n = t.cloneRange();
            n.selectNodeContents(e);
            var r = n.intersection(t),
                i = r ? r.toString() : "";
            return n.detach(), i
        },
        isAppliedToRange: function (t) {
            var n = [],
                r, i = t.getNodes([e.TEXT_NODE]);
            if (!i.length) return r = this.getAncestorWithClass(t.startContainer), r ? [r] : !1;
            for (var s = 0, o = i.length, u; s < o; ++s) {
                u = this.getTextSelectedByRange(i[s], t), r = this.getAncestorWithClass(i[s]);
                if (u != "" && !r) return !1;
                n.push(r)
            }
            return n
        },
        toggleRange: function (e) {
            this.isAppliedToRange(e) ? this.undoToRange(e) : this.applyToRange(e)
        }
    }, e.selection.HTMLApplier = p
}(wysihtml5, rangy), wysihtml5.Commands = Base.extend({
    constructor: function (e) {
        this.editor = e, this.composer = e.composer, this.doc = this.composer.doc
    },
    support: function (e) {
        return wysihtml5.browser.supportsCommand(this.doc, e)
    },
    exec: function (e, t) {
        var n = wysihtml5.commands[e],
            r = wysihtml5.lang.array(arguments).get(),
            i = n && n.exec,
            s = null;
        this.editor.fire("beforecommand:composer");
        if (i) r.unshift(this.composer), s = i.apply(n, r);
        else try {
            s = this.doc.execCommand(e, !1, t)
        } catch (o) {}
        return this.editor.fire("aftercommand:composer"), s
    },
    state: function (e, t) {
        var n = wysihtml5.commands[e],
            r = wysihtml5.lang.array(arguments).get(),
            i = n && n.state;
        if (i) return r.unshift(this.composer), i.apply(n, r);
        try {
            return this.doc.queryCommandState(e)
        } catch (s) {
            return !1
        }
    },
    value: function (e) {
        var t = wysihtml5.commands[e],
            n = t && t.value;
        if (n) return n.call(t, this.composer, e);
        try {
            return this.doc.queryCommandValue(e)
        } catch (r) {
            return null
        }
    }
}),
function (e) {
    var t;
    e.commands.bold = {
        exec: function (t, n) {
            return e.commands.formatInline.exec(t, n, "b")
        },
        state: function (t, n, r) {
            return e.commands.formatInline.state(t, n, "b")
        },
        value: function () {
            return t
        }
    }
}(wysihtml5),
function (e) {
    function i(e, t) {
        var n = t.length,
            i = 0,
            s, o, u;
        for (; i < n; i++) s = t[i], o = r.getParentElement(s, {
            nodeName: "code"
        }), u = r.getTextContent(s), u.match(r.autoLink.URL_REG_EXP) && !o ? o = r.renameElement(s, "code") : r.replaceWithChildNodes(s)
    }

    function s(i, s) {
        var o = i.doc,
            u = "_wysihtml5-temp-" + +(new Date),
            a = /non-matching-class/g,
            f = 0,
            l, c, h, p, d, v, m, g, y;
        e.commands.formatInline.exec(i, t, n, u, a), c = o.querySelectorAll(n + "." + u), l = c.length;
        for (; f < l; f++) {
            h = c[f], h.removeAttribute("class");
            for (y in s) h.setAttribute(y, s[y])
        }
        v = h, l === 1 && (m = r.getTextContent(h), p = !! h.querySelector("*"), d = m === "" || m === e.INVISIBLE_SPACE, !p && d && (r.setTextContent(h, s.text || h.href), g = o.createTextNode(" "), i.selection.setAfter(h), i.selection.insertNode(g), v = g)), i.selection.setAfter(v)
    }
    var t, n = "A",
        r = e.dom;
    e.commands.createLink = {
        exec: function (e, t, n) {
            var r = this.state(e, t);
            r ? e.selection.executeAndRestore(function () {
                i(e, r)
            }) : (n = typeof n == "object" ? n : {
                href: n
            }, s(e, n))
        },
        state: function (t, n) {
            return e.commands.formatInline.state(t, n, "A")
        },
        value: function () {
            return t
        }
    }
}(wysihtml5),
function (e) {
    var t, n = /wysiwyg-font-size-[a-z\-]+/g;
    e.commands.fontSize = {
        exec: function (t, r, i) {
            return e.commands.formatInline.exec(t, r, "span", "wysiwyg-font-size-" + i, n)
        },
        state: function (t, r, i) {
            return e.commands.formatInline.state(t, r, "span", "wysiwyg-font-size-" + i, n)
        },
        value: function () {
            return t
        }
    }
}(wysihtml5),
function (e) {
    var t, n = /wysiwyg-color-[a-z]+/g;
    e.commands.foreColor = {
        exec: function (t, r, i) {
            return e.commands.formatInline.exec(t, r, "span", "wysiwyg-color-" + i, n)
        },
        state: function (t, r, i) {
            return e.commands.formatInline.state(t, r, "span", "wysiwyg-color-" + i, n)
        },
        value: function () {
            return t
        }
    }
}(wysihtml5),
function (e) {
    function s(e, t, n) {
        e.className ? (o(e, n), e.className += " " + t) : e.className = t
    }

    function o(e, t) {
        e.className = e.className.replace(t, "")
    }

    function u(t) {
        return t.nodeType === e.TEXT_NODE && !e.lang.string(t.data).trim()
    }

    function a(e) {
        var t = e.previousSibling;
        while (t && u(t)) t = t.previousSibling;
        return t
    }

    function f(e) {
        var t = e.nextSibling;
        while (t && u(t)) t = t.nextSibling;
        return t
    }

    function l(e) {
        var t = e.ownerDocument,
            n = f(e),
            r = a(e);
        n && !d(n) && e.parentNode.insertBefore(t.createElement("br"), n), r && !d(r) && e.parentNode.insertBefore(t.createElement("br"), e)
    }

    function c(e) {
        var t = f(e),
            n = a(e);
        t && p(t) && t.parentNode.removeChild(t), n && p(n) && n.parentNode.removeChild(n)
    }

    function h(e) {
        var t = e.lastChild;
        t && p(t) && t.parentNode.removeChild(t)
    }

    function p(e) {
        return e.nodeName === "BR"
    }

    function d(e) {
        return p(e) ? !0 : n.getStyle("display").from(e) === "block" ? !0 : !1
    }

    function v(t, r, i, s) {
        if (s) var o = n.observe(t, "DOMNodeInserted", function (t) {
            var r = t.target,
                i;
            if (r.nodeType !== e.ELEMENT_NODE) return;
            i = n.getStyle("display").from(r), i.substr(0, 6) !== "inline" && (r.className += " " + s)
        });
        t.execCommand(r, !1, i), o && o.stop()
    }

    function m(e, t) {
        e.selection.selectLine(), e.selection.surround(t), c(t), h(t), e.selection.selectNode(t)
    }

    function g(t) {
        return !!e.lang.string(t.className).trim()
    }
    var t, n = e.dom,
        r = "DIV",
        i = ["H1", "H2", "H3", "H4", "H5", "H6", "P", "BLOCKQUOTE", r];
    e.commands.formatBlock = {
        exec: function (t, u, a, f, c) {
            var h = t.doc,
                p = this.state(t, u, a, f, c),
                d;
            a = typeof a == "string" ? a.toUpperCase() : a;
            if (p) {
                t.selection.executeAndRestoreSimple(function () {
                    c && o(p, c);
                    var e = g(p);
                    !e && p.nodeName === (a || r) ? (l(p), n.replaceWithChildNodes(p)) : e && n.renameElement(p, r)
                });
                return
            }
            if (a === null || e.lang.array(i).contains(a)) {
                d = t.selection.getSelectedNode(), p = n.getParentElement(d, {
                    nodeName: i
                });
                if (p) {
                    t.selection.executeAndRestoreSimple(function () {
                        a && (p = n.renameElement(p, a)), f && s(p, f, c)
                    });
                    return
                }
            }
            if (t.commands.support(u)) {
                v(h, u, a || r, f);
                return
            }
            p = h.createElement(a || r), f && (p.className = f), m(t, p)
        },
        state: function (e, t, r, i, s) {
            r = typeof r == "string" ? r.toUpperCase() : r;
            var o = e.selection.getSelectedNode();
            return n.getParentElement(o, {
                nodeName: r,
                className: i,
                classRegExp: s
            })
        },
        value: function () {
            return t
        }
    }
}(wysihtml5),
function (e) {
    function i(e) {
        var t = n[e];
        return t ? [e.toLowerCase(), t.toLowerCase()] : [e.toLowerCase()]
    }

    function s(t, n, s) {
        var o = t + ":" + n;
        return r[o] || (r[o] = new e.selection.HTMLApplier(i(t), n, s, !0)), r[o]
    }
    var t, n = {
            strong: "b",
            em: "i",
            b: "strong",
            i: "em"
        }, r = {};
    e.commands.formatInline = {
        exec: function (e, t, n, r, i) {
            var o = e.selection.getRange();
            if (!o) return !1;
            s(n, r, i).toggleRange(o), e.selection.setSelection(o)
        },
        state: function (t, r, i, o, u) {
            var a = t.doc,
                f = n[i] || i,
                l;
            return !e.dom.hasElementWithTagName(a, i) && !e.dom.hasElementWithTagName(a, f) ? !1 : o && !e.dom.hasElementWithClassName(a, o) ? !1 : (l = t.selection.getRange(), l ? s(i, o, u).isAppliedToRange(l) : !1)
        },
        value: function () {
            return t
        }
    }
}(wysihtml5),
function (e) {
    var t;
    e.commands.insertHTML = {
        exec: function (e, t, n) {
            e.commands.support(t) ? e.doc.execCommand(t, !1, n) : e.selection.insertHTML(n)
        },
        state: function () {
            return !1
        },
        value: function () {
            return t
        }
    }
}(wysihtml5),
function (e) {
    var t = "IMG";
    e.commands.insertImage = {
        exec: function (n, r, i) {
            i = typeof i == "object" ? i : {
                src: i
            };
            var s = n.doc,
                o = this.state(n),
                u, a, f;
            if (o) {
                n.selection.setBefore(o), f = o.parentNode, f.removeChild(o), e.dom.removeEmptyTextNodes(f), f.nodeName === "A" && !f.firstChild && (n.selection.setAfter(f), f.parentNode.removeChild(f)), e.quirks.redraw(n.element);
                return
            }
            o = s.createElement(t);
            for (a in i) o[a] = i[a];
            n.selection.insertNode(o), e.browser.hasProblemsSettingCaretAfterImg() ? (u = s.createTextNode(e.INVISIBLE_SPACE), n.selection.insertNode(u), n.selection.setAfter(u)) : n.selection.setAfter(o)
        },
        state: function (n) {
            var r = n.doc,
                i, s, o;
            return e.dom.hasElementWithTagName(r, t) ? (i = n.selection.getSelectedNode(), i ? i.nodeName === t ? i : i.nodeType !== e.ELEMENT_NODE ? !1 : (s = n.selection.getText(), s = e.lang.string(s).trim(), s ? !1 : (o = n.selection.getNodes(e.ELEMENT_NODE, function (e) {
                return e.nodeName === "IMG"
            }), o.length !== 1 ? !1 : o[0])) : !1) : !1
        },
        value: function (e) {
            var t = this.state(e);
            return t && t.src
        }
    }
}(wysihtml5),
function (e) {
    var t, n = "<br>" + (e.browser.needsSpaceAfterLineBreak() ? " " : "");
    e.commands.insertLineBreak = {
        exec: function (t, r) {
            t.commands.support(r) ? (t.doc.execCommand(r, !1, null), e.browser.autoScrollsToCaret() || t.selection.scrollIntoView()) : t.commands.exec("insertHTML", n)
        },
        state: function () {
            return !1
        },
        value: function () {
            return t
        }
    }
}(wysihtml5),
function (e) {
    var t;
    e.commands.insertOrderedList = {
        exec: function (t, n) {
            var r = t.doc,
                i = t.selection.getSelectedNode(),
                s = e.dom.getParentElement(i, {
                    nodeName: "OL"
                }),
                o = e.dom.getParentElement(i, {
                    nodeName: "UL"
                }),
                u = "_wysihtml5-temp-" + (new Date).getTime(),
                a, f;
            if (t.commands.support(n)) {
                r.execCommand(n, !1, null);
                return
            }
            s ? t.selection.executeAndRestoreSimple(function () {
                e.dom.resolveList(s)
            }) : o ? t.selection.executeAndRestoreSimple(function () {
                e.dom.renameElement(o, "ol")
            }) : (t.commands.exec("formatBlock", "div", u), f = r.querySelector("." + u), a = f.innerHTML === "" || f.innerHTML === e.INVISIBLE_SPACE, t.selection.executeAndRestoreSimple(function () {
                s = e.dom.convertToList(f, "ol")
            }), a && t.selection.selectNode(s.querySelector("li")))
        },
        state: function (t) {
            var n = t.selection.getSelectedNode();
            return e.dom.getParentElement(n, {
                nodeName: "OL"
            })
        },
        value: function () {
            return t
        }
    }
}(wysihtml5),
function (e) {
    var t;
    e.commands.insertUnorderedList = {
        exec: function (t, n) {
            var r = t.doc,
                i = t.selection.getSelectedNode(),
                s = e.dom.getParentElement(i, {
                    nodeName: "UL"
                }),
                o = e.dom.getParentElement(i, {
                    nodeName: "OL"
                }),
                u = "_wysihtml5-temp-" + (new Date).getTime(),
                a, f;
            if (t.commands.support(n)) {
                r.execCommand(n, !1, null);
                return
            }
            s ? t.selection.executeAndRestoreSimple(function () {
                e.dom.resolveList(s)
            }) : o ? t.selection.executeAndRestoreSimple(function () {
                e.dom.renameElement(o, "ul")
            }) : (t.commands.exec("formatBlock", "div", u), f = r.querySelector("." + u), a = f.innerHTML === "" || f.innerHTML === e.INVISIBLE_SPACE, t.selection.executeAndRestoreSimple(function () {
                s = e.dom.convertToList(f, "ul")
            }), a && t.selection.selectNode(s.querySelector("li")))
        },
        state: function (t) {
            var n = t.selection.getSelectedNode();
            return e.dom.getParentElement(n, {
                nodeName: "UL"
            })
        },
        value: function () {
            return t
        }
    }
}(wysihtml5),
function (e) {
    var t;
    e.commands.italic = {
        exec: function (t, n) {
            return e.commands.formatInline.exec(t, n, "i")
        },
        state: function (t, n, r) {
            return e.commands.formatInline.state(t, n, "i")
        },
        value: function () {
            return t
        }
    }
}(wysihtml5),
function (e) {
    var t, n = "wysiwyg-text-align-center",
        r = /wysiwyg-text-align-[a-z]+/g;
    e.commands.justifyCenter = {
        exec: function (t, i) {
            return e.commands.formatBlock.exec(t, "formatBlock", null, n, r)
        },
        state: function (t, i) {
            return e.commands.formatBlock.state(t, "formatBlock", null, n, r)
        },
        value: function () {
            return t
        }
    }
}(wysihtml5),
function (e) {
    var t, n = "wysiwyg-text-align-left",
        r = /wysiwyg-text-align-[a-z]+/g;
    e.commands.justifyLeft = {
        exec: function (t, i) {
            return e.commands.formatBlock.exec(t, "formatBlock", null, n, r)
        },
        state: function (t, i) {
            return e.commands.formatBlock.state(t, "formatBlock", null, n, r)
        },
        value: function () {
            return t
        }
    }
}(wysihtml5),
function (e) {
    var t, n = "wysiwyg-text-align-right",
        r = /wysiwyg-text-align-[a-z]+/g;
    e.commands.justifyRight = {
        exec: function (t, i) {
            return e.commands.formatBlock.exec(t, "formatBlock", null, n, r)
        },
        state: function (t, i) {
            return e.commands.formatBlock.state(t, "formatBlock", null, n, r)
        },
        value: function () {
            return t
        }
    }
}(wysihtml5),
function (e) {
    var t;
    e.commands.underline = {
        exec: function (t, n) {
            return e.commands.formatInline.exec(t, n, "u")
        },
        state: function (t, n) {
            return e.commands.formatInline.state(t, n, "u")
        },
        value: function () {
            return t
        }
    }
}(wysihtml5),
function (e) {
    function f(e) {
        var t;
        while (t = e.querySelector("._wysihtml5-temp")) t.parentNode.removeChild(t)
    }
    var t = 90,
        n = 89,
        r = 8,
        i = 46,
        s = 40,
        o = '<span id="_wysihtml5-undo" class="_wysihtml5-temp">' + e.INVISIBLE_SPACE + "</span>",
        u = '<span id="_wysihtml5-redo" class="_wysihtml5-temp">' + e.INVISIBLE_SPACE + "</span>",
        a = e.dom;
    e.UndoManager = e.lang.Dispatcher.extend({
        constructor: function (e) {
            this.editor = e, this.composer = e.composer, this.element = this.composer.element, this.history = [this.composer.getValue()], this.position = 1, this.composer.commands.support("insertHTML") && this._observe()
        },
        _observe: function () {
            var s = this,
                l = this.composer.sandbox.getDocument(),
                c;
            a.observe(this.element, "keydown", function (e) {
                if (e.altKey || !e.ctrlKey && !e.metaKey) return;
                var r = e.keyCode,
                    i = r === t && !e.shiftKey,
                    o = r === t && e.shiftKey || r === n;
                i ? (s.undo(), e.preventDefault()) : o && (s.redo(), e.preventDefault())
            }), a.observe(this.element, "keydown", function (e) {
                var t = e.keyCode;
                if (t === c) return;
                c = t, (t === r || t === i) && s.transact()
            });
            if (e.browser.hasUndoInContextMenu()) {
                var h, p, d = function () {
                        f(l), clearInterval(h)
                    };
                a.observe(this.element, "contextmenu", function () {
                    d(), s.composer.selection.executeAndRestoreSimple(function () {
                        s.element.lastChild && s.composer.selection.setAfter(s.element.lastChild), l.execCommand("insertHTML", !1, o), l.execCommand("insertHTML", !1, u), l.execCommand("undo", !1, null)
                    }), h = setInterval(function () {
                        l.getElementById("_wysihtml5-redo") ? (d(), s.redo()) : l.getElementById("_wysihtml5-undo") || (d(), s.undo())
                    }, 400), p || (p = !0, a.observe(document, "mousedown", d), a.observe(l, ["mousedown", "paste", "cut", "copy"], d))
                })
            }
            this.editor.observe("newword:composer", function () {
                s.transact()
            }).observe("beforecommand:composer", function () {
                s.transact()
            })
        },
        transact: function () {
            var e = this.history[this.position - 1],
                t = this.composer.getValue();
            if (t == e) return;
            var n = this.history.length = this.position;
            n > s && (this.history.shift(), this.position--), this.position++, this.history.push(t)
        },
        undo: function () {
            this.transact();
            if (this.position <= 1) return;
            this.set(this.history[--this.position - 1]), this.editor.fire("undo:composer")
        },
        redo: function () {
            if (this.position >= this.history.length) return;
            this.set(this.history[++this.position - 1]), this.editor.fire("redo:composer")
        },
        set: function (e) {
            this.composer.setValue(e), this.editor.focus(!0)
        }
    })
}(wysihtml5), wysihtml5.views.View = Base.extend({
    constructor: function (e, t, n) {
        this.parent = e, this.element = t, this.config = n, this._observeViewChange()
    },
    _observeViewChange: function () {
        var e = this;
        this.parent.observe("beforeload", function () {
            e.parent.observe("change_view", function (t) {
                t === e.name ? (e.parent.currentView = e, e.show(), setTimeout(function () {
                    e.focus()
                }, 0)) : e.hide()
            })
        })
    },
    focus: function () {
        if (this.element.ownerDocument.querySelector(":focus") === this.element) return;
        try {
            this.element.focus()
        } catch (e) {}
    },
    hide: function () {
        this.element.style.display = "none"
    },
    show: function () {
        this.element.style.display = ""
    },
    disable: function () {
        this.element.setAttribute("disabled", "disabled")
    },
    enable: function () {
        this.element.removeAttribute("disabled")
    }
}),
function (e) {
    var t = e.dom,
        n = e.browser;
    e.views.Composer = e.views.View.extend({
        name: "composer",
        CARET_HACK: "<br>",
        constructor: function (e, t, n) {
            this.base(e, t, n), this.textarea = this.parent.textarea, this._initSandbox()
        },
        clear: function () {
            this.element.innerHTML = n.displaysCaretInEmptyContentEditableCorrectly() ? "" : this.CARET_HACK
        },
        getValue: function (t) {
            var n = this.isEmpty() ? "" : e.quirks.getCorrectInnerHTML(this.element);
            return t && (n = this.parent.parse(n)), n = e.lang.string(n).replace(e.INVISIBLE_SPACE).by(""), n
        },
        setValue: function (e, t) {
            t && (e = this.parent.parse(e)), this.element.innerHTML = e
        },
        show: function () {
            this.iframe.style.display = this._displayStyle || "", this.disable(), this.enable()
        },
        hide: function () {
            this._displayStyle = t.getStyle("display").from(this.iframe), this._displayStyle === "none" && (this._displayStyle = null), this.iframe.style.display = "none"
        },
        disable: function () {
            this.element.removeAttribute("contentEditable"), this.base()
        },
        enable: function () {
            this.element.setAttribute("contentEditable", "true"), this.base()
        },
        focus: function (t) {
            e.browser.doesAsyncFocus() && this.hasPlaceholderSet() && this.clear(), this.base();
            var n = this.element.lastChild;
            t && n && (n.nodeName === "BR" ? this.selection.setBefore(this.element.lastChild) : this.selection.setAfter(this.element.lastChild))
        },
        getTextContent: function () {
            return t.getTextContent(this.element)
        },
        hasPlaceholderSet: function () {
            return this.getTextContent() == this.textarea.element.getAttribute("placeholder")
        },
        isEmpty: function () {
            var e = this.element.innerHTML,
                t = "blockquote, ul, ol, img, embed, object, table, iframe, svg, video, audio, button, input, select, textarea";
            return e === "" || e === this.CARET_HACK || this.hasPlaceholderSet() || this.getTextContent() === "" && !this.element.querySelector(t)
        },
        _initSandbox: function () {
            var e = this;
            this.sandbox = new t.Sandbox(function () {
                e._create()
            }, {
                stylesheets: this.config.stylesheets
            }), this.iframe = this.sandbox.getIframe();
            var n = document.createElement("input");
            n.type = "hidden", n.name = "_wysihtml5_mode", n.value = 1;
            var r = this.textarea.element;
            t.insert(this.iframe).after(r), t.insert(n).after(r)
        },
        _create: function () {
            var r = this;
            this.doc = this.sandbox.getDocument(), this.element = this.doc.body, this.textarea = this.parent.textarea, this.element.innerHTML = this.textarea.getValue(!0), this.enable(), this.selection = new e.Selection(this.parent), this.commands = new e.Commands(this.parent), t.copyAttributes(["className", "spellcheck", "title", "lang", "dir", "accessKey"]).from(this.textarea.element).to(this.element), t.addClass(this.element, this.config.composerClassName), this.config.style && this.style(), this.observe();
            var i = this.config.name;
            i && (t.addClass(this.element, i), t.addClass(this.iframe, i));
            var s = typeof this.config.placeholder == "string" ? this.config.placeholder : this.textarea.element.getAttribute("placeholder");
            s && t.simulatePlaceholder(this.parent, this, s), this.commands.exec("styleWithCSS", !1), this._initAutoLinking(), this._initObjectResizing(), this._initUndoManager(), (this.textarea.element.hasAttribute("autofocus") || document.querySelector(":focus") == this.textarea.element) && setTimeout(function () {
                r.focus()
            }, 100), e.quirks.insertLineBreakOnReturn(this), n.clearsContentEditableCorrectly() || e.quirks.ensureProperClearing(this), n.clearsListsInContentEditableCorrectly() || e.quirks.ensureProperClearingOfLists(this), this.initSync && this.config.sync && this.initSync(), this.textarea.hide(), this.parent.fire("beforeload").fire("load")
        },
        _initAutoLinking: function () {
            var r = this,
                i = n.canDisableAutoLinking(),
                s = n.doesAutoLinkingInContentEditable();
            i && this.commands.exec("autoUrlDetect", !1);
            if (!this.config.autoLink) return;
            (!s || s && i) && this.parent.observe("newword:composer", function () {
                r.selection.executeAndRestore(function (e, n) {
                    t.autoLink(n.parentNode)
                })
            });
            var o = this.sandbox.getDocument().getElementsByTagName("a"),
                u = t.autoLink.URL_REG_EXP,
                a = function (n) {
                    var r = e.lang.string(t.getTextContent(n)).trim();
                    return r.substr(0, 4) === "www." && (r = "http://" + r), r
                };
            t.observe(this.element, "keydown", function (e) {
                if (!o.length) return;
                var n = r.selection.getSelectedNode(e.target.ownerDocument),
                    i = t.getParentElement(n, {
                        nodeName: "A"
                    }, 4),
                    s;
                if (!i) return;
                s = a(i), setTimeout(function () {
                    var e = a(i);
                    if (e === s) return;
                    e.match(u) && i.setAttribute("href", e)
                }, 0)
            })
        },
        _initObjectResizing: function () {
            var r = ["width", "height"],
                i = r.length,
                s = this.element;
            this.commands.exec("enableObjectResizing", this.config.allowObjectResizing), this.config.allowObjectResizing ? n.supportsEvent("resizeend") && t.observe(s, "resizeend", function (t) {
                var n = t.target || t.srcElement,
                    o = n.style,
                    u = 0,
                    a;
                for (; u < i; u++) a = r[u], o[a] && (n.setAttribute(a, parseInt(o[a], 10)), o[a] = "");
                e.quirks.redraw(s)
            }) : n.supportsEvent("resizestart") && t.observe(s, "resizestart", function (e) {
                e.preventDefault()
            })
        },
        _initUndoManager: function () {
            new e.UndoManager(this.parent)
        }
    })
}(wysihtml5),
function (e) {
    var t = e.dom,
        n = document,
        r = window,
        i = n.createElement("div"),
        s = ["background-color", "color", "cursor", "font-family", "font-size", "font-style", "font-variant", "font-weight", "line-height", "letter-spacing", "text-align", "text-decoration", "text-indent", "text-rendering", "word-break", "word-wrap", "word-spacing"],
        o = ["background-color", "border-collapse", "border-bottom-color", "border-bottom-style", "border-bottom-width", "border-left-color", "border-left-style", "border-left-width", "border-right-color", "border-right-style", "border-right-width", "border-top-color", "border-top-style", "border-top-width", "clear", "display", "float", "margin-bottom", "margin-left", "margin-right", "margin-top", "outline-color", "outline-offset", "outline-width", "outline-style", "padding-left", "padding-right", "padding-top", "padding-bottom", "position", "top", "left", "right", "bottom", "z-index", "vertical-align", "text-align", "-webkit-box-sizing", "-moz-box-sizing", "-ms-box-sizing", "box-sizing", "-webkit-box-shadow", "-moz-box-shadow", "-ms-box-shadow", "box-shadow", "-webkit-border-top-right-radius", "-moz-border-radius-topright", "border-top-right-radius", "-webkit-border-bottom-right-radius", "-moz-border-radius-bottomright", "border-bottom-right-radius", "-webkit-border-bottom-left-radius", "-moz-border-radius-bottomleft", "border-bottom-left-radius", "-webkit-border-top-left-radius", "-moz-border-radius-topleft", "border-top-left-radius", "width", "height"],
        u = ["width", "height", "top", "left", "right", "bottom"],
        a = ["html             { height: 100%; }", "body             { min-height: 100%; padding: 0; margin: 0; margin-top: -1px; padding-top: 1px; }", "._wysihtml5-temp { display: none; }", e.browser.isGecko ? "body.placeholder { color: graytext !important; }" : "body.placeholder { color: #a9a9a9 !important; }", "body[disabled]   { background-color: #eee !important; color: #999 !important; cursor: default !important; }", "img:-moz-broken  { -moz-force-broken-image-icon: 1; height: 24px; width: 24px; }"],
        f = function (e) {
            if (e.setActive) try {
                e.setActive()
            } catch (i) {} else {
                var s = e.style,
                    o = n.documentElement.scrollTop || n.body.scrollTop,
                    u = n.documentElement.scrollLeft || n.body.scrollLeft,
                    a = {
                        position: s.position,
                        top: s.top,
                        left: s.left,
                        WebkitUserSelect: s.WebkitUserSelect
                    };
                t.setStyles({
                    position: "absolute",
                    top: "-99999px",
                    left: "-99999px",
                    WebkitUserSelect: "none"
                }).on(e), e.focus(), t.setStyles(a).on(e), r.scrollTo && r.scrollTo(u, o)
            }
        };
    e.views.Composer.prototype.style = function () {
        var l = this,
            c = n.querySelector(":focus"),
            h = this.textarea.element,
            p = h.hasAttribute("placeholder"),
            d = p && h.getAttribute("placeholder");
        this.focusStylesHost = this.focusStylesHost || i.cloneNode(!1), this.blurStylesHost = this.blurStylesHost || i.cloneNode(!1), p && h.removeAttribute("placeholder"), h === c && h.blur(), t.copyStyles(o).from(h).to(this.iframe).andTo(this.blurStylesHost), t.copyStyles(s).from(h).to(this.element).andTo(this.blurStylesHost), t.insertCSS(a).into(this.element.ownerDocument), f(h), t.copyStyles(o).from(h).to(this.focusStylesHost), t.copyStyles(s).from(h).to(this.focusStylesHost);
        var v = e.lang.array(o).without(["display"]);
        c ? c.focus() : h.blur(), p && h.setAttribute("placeholder", d);
        if (!e.browser.hasCurrentStyleProperty()) var m = t.observe(r, "resize", function () {
            if (!t.contains(document.documentElement, l.iframe)) {
                m.stop();
                return
            }
            var e = t.getStyle("display").from(h),
                n = t.getStyle("display").from(l.iframe);
            h.style.display = "", l.iframe.style.display = "none", t.copyStyles(u).from(h).to(l.iframe).andTo(l.focusStylesHost).andTo(l.blurStylesHost), l.iframe.style.display = n, h.style.display = e
        });
        return this.parent.observe("focus:composer", function () {
            t.copyStyles(v).from(l.focusStylesHost).to(l.iframe), t.copyStyles(s).from(l.focusStylesHost).to(l.element)
        }), this.parent.observe("blur:composer", function () {
            t.copyStyles(v).from(l.blurStylesHost).to(l.iframe), t.copyStyles(s).from(l.blurStylesHost).to(l.element)
        }), this
    }
}(wysihtml5),
function (e) {
    var t = e.dom,
        n = e.browser,
        r = {
            66: "bold",
            73: "italic",
            85: "underline"
        };
    e.views.Composer.prototype.observe = function () {
        var i = this,
            s = this.getValue(),
            o = this.sandbox.getIframe(),
            u = this.element,
            a = n.supportsEventsInIframeCorrectly() ? u : this.sandbox.getWindow(),
            f = n.supportsEvent("drop") ? ["drop", "paste"] : ["dragdrop", "paste"];
        t.observe(o, "DOMNodeRemoved", function () {
            clearInterval(l), i.parent.fire("destroy:composer")
        });
        var l = setInterval(function () {
            t.contains(document.documentElement, o) || (clearInterval(l), i.parent.fire("destroy:composer"))
        }, 250);
        t.observe(a, "focus", function () {
            i.parent.fire("focus").fire("focus:composer"), setTimeout(function () {
                s = i.getValue()
            }, 0)
        }), t.observe(a, "blur", function () {
            s !== i.getValue() && i.parent.fire("change").fire("change:composer"), i.parent.fire("blur").fire("blur:composer")
        }), e.browser.isIos() && t.observe(u, "blur", function () {
            var e = u.ownerDocument.createElement("input"),
                t = document.documentElement.scrollTop || document.body.scrollTop,
                n = document.documentElement.scrollLeft || document.body.scrollLeft;
            try {
                i.selection.insertNode(e)
            } catch (r) {
                u.appendChild(e)
            }
            e.focus(), e.parentNode.removeChild(e), window.scrollTo(n, t)
        }), t.observe(u, "dragenter", function () {
            i.parent.fire("unset_placeholder")
        }), n.firesOnDropOnlyWhenOnDragOverIsCancelled() && t.observe(u, ["dragover", "dragenter"], function (e) {
            e.preventDefault()
        }), t.observe(u, f, function (e) {
            var t = e.dataTransfer,
                r;
            console.log("PASTED", e), t && n.supportsDataTransfer() && (r = t.getData("text/html") || t.getData("text/plain")), r ? (u.focus(), i.commands.exec("insertHTML", r), i.parent.fire("paste").fire("paste:composer"), e.stopPropagation(), e.preventDefault()) : setTimeout(function () {
                i.parent.fire("paste").fire("paste:composer")
            }, 0)
        }), t.observe(u, "keyup", function (t) {
            var n = t.keyCode;
            (n === e.SPACE_KEY || n === e.ENTER_KEY) && i.parent.fire("newword:composer")
        }), this.parent.observe("paste:composer", function () {
            setTimeout(function () {
                i.parent.fire("newword:composer")
            }, 0)
        }), n.canSelectImagesInContentEditable() || t.observe(u, "mousedown", function (e) {
            var t = e.target;
            t.nodeName === "IMG" && (i.selection.selectNode(t), e.preventDefault())
        }), t.observe(u, "keydown", function (e) {
            var t = e.keyCode,
                n = r[t];
            (e.ctrlKey || e.metaKey) && !e.altKey && n && (i.commands.exec(n), e.preventDefault())
        }), t.observe(u, "keydown", function (t) {
            var n = i.selection.getSelectedNode(!0),
                r = t.keyCode,
                s;
            n && n.nodeName === "IMG" && (r === e.BACKSPACE_KEY || r === e.DELETE_KEY) && (s = n.parentNode, s.removeChild(n), s.nodeName === "A" && !s.firstChild && s.parentNode.removeChild(s), setTimeout(function () {
                e.quirks.redraw(u)
            }, 0), t.preventDefault())
        });
        var c = {
            IMG: "Image: ",
            A: "Link: "
        };
        t.observe(u, "mouseover", function (e) {
            var t = e.target,
                n = t.nodeName,
                r;
            if (n !== "A" && n !== "IMG") return;
            var i = t.hasAttribute("title");
            i || (r = c[n] + (t.getAttribute("href") || t.getAttribute("src")), t.setAttribute("title", r))
        })
    }
}(wysihtml5),
function (e) {
    var t = 400;
    e.views.Synchronizer = Base.extend({
        constructor: function (e, t, n) {
            this.editor = e, this.textarea = t, this.composer = n, this._observe()
        },
        fromComposerToTextarea: function (t) {
            this.textarea.setValue(e.lang.string(this.composer.getValue()).trim(), t)
        },
        fromTextareaToComposer: function (e) {
            var t = this.textarea.getValue();
            t ? this.composer.setValue(t, e) : (this.composer.clear(), this.editor.fire("set_placeholder"))
        },
        sync: function (e) {
            this.editor.currentView.name === "textarea" ? this.fromTextareaToComposer(e) : this.fromComposerToTextarea(e)
        },
        _observe: function () {
            var n, r = this,
                i = this.textarea.element.form,
                s = function () {
                    n = setInterval(function () {
                        r.fromComposerToTextarea()
                    }, t)
                }, o = function () {
                    clearInterval(n), n = null
                };
            s(), i && (e.dom.observe(i, "submit", function () {
                r.sync(!0)
            }), e.dom.observe(i, "reset", function () {
                setTimeout(function () {
                    r.fromTextareaToComposer()
                }, 0)
            })), this.editor.observe("change_view", function (e) {
                e === "composer" && !n ? (r.fromTextareaToComposer(!0), s()) : e === "textarea" && (r.fromComposerToTextarea(!0), o())
            }), this.editor.observe("destroy:composer", o)
        }
    })
}(wysihtml5), wysihtml5.views.Textarea = wysihtml5.views.View.extend({
    name: "textarea",
    constructor: function (e, t, n) {
        this.base(e, t, n), this._observe()
    },
    clear: function () {
        this.element.value = ""
    },
    getValue: function (e) {
        var t = this.isEmpty() ? "" : this.element.value;
        return e && (t = this.parent.parse(t)), t
    },
    setValue: function (e, t) {
        t && (e = this.parent.parse(e)), this.element.value = e
    },
    hasPlaceholderSet: function () {
        var e = wysihtml5.browser.supportsPlaceholderAttributeOn(this.element),
            t = this.element.getAttribute("placeholder") || null,
            n = this.element.value,
            r = !n;
        return e && r || n === t
    },
    isEmpty: function () {
        return !wysihtml5.lang.string(this.element.value).trim() || this.hasPlaceholderSet()
    },
    _observe: function () {
        var e = this.element,
            t = this.parent,
            n = {
                focusin: "focus",
                focusout: "blur"
            }, r = wysihtml5.browser.supportsEvent("focusin") ? ["focusin", "focusout", "change"] : ["focus", "blur", "change"];
        t.observe("beforeload", function () {
            wysihtml5.dom.observe(e, r, function (e) {
                var r = n[e.type] || e.type;
                t.fire(r).fire(r + ":textarea")
            }), wysihtml5.dom.observe(e, ["paste", "drop"], function () {
                setTimeout(function () {
                    t.fire("paste").fire("paste:textarea")
                }, 0)
            })
        })
    }
}),
function (e) {
    var t = e.dom,
        n = "wysihtml5-command-dialog-opened",
        r = "input, select, textarea",
        i = "[data-wysihtml5-dialog-field]",
        s = "data-wysihtml5-dialog-field";
    e.toolbar.Dialog = e.lang.Dispatcher.extend({
        constructor: function (e, t) {
            this.link = e, this.container = t
        },
        _observe: function () {
            if (this._observed) return;
            var i = this,
                s = function (e) {
                    var t = i._serialize();
                    t == i.elementToChange ? i.fire("edit", t) : i.fire("save", t), i.hide(), e.preventDefault(), e.stopPropagation()
                };
            t.observe(i.link, "click", function (e) {
                t.hasClass(i.link, n) && setTimeout(function () {
                    i.hide()
                }, 0)
            }), t.observe(this.container, "keydown", function (t) {
                var n = t.keyCode;
                n === e.ENTER_KEY && s(t), n === e.ESCAPE_KEY && i.hide()
            }), t.delegate(this.container, "[data-wysihtml5-dialog-action=save]", "click", s), t.delegate(this.container, "[data-wysihtml5-dialog-action=cancel]", "click", function (e) {
                i.fire("cancel"), i.hide(), e.preventDefault(), e.stopPropagation()
            });
            var o = this.container.querySelectorAll(r),
                u = 0,
                a = o.length,
                f = function () {
                    clearInterval(i.interval)
                };
            for (; u < a; u++) t.observe(o[u], "change", f);
            this._observed = !0
        },
        _serialize: function () {
            var e = this.elementToChange || {}, t = this.container.querySelectorAll(i),
                n = t.length,
                r = 0;
            for (; r < n; r++) e[t[r].getAttribute(s)] = t[r].value;
            return e
        },
        _interpolate: function (e) {
            var t, n, r, o = document.querySelector(":focus"),
                u = this.container.querySelectorAll(i),
                a = u.length,
                f = 0;
            for (; f < a; f++) {
                t = u[f];
                if (t === o) continue;
                if (e && t.type === "hidden") continue;
                n = t.getAttribute(s), r = this.elementToChange ? this.elementToChange[n] || "" : t.defaultValue, t.value = r
            }
        },
        show: function (e) {
            var i = this,
                s = this.container.querySelector(r);
            this.elementToChange = e, this._observe(), this._interpolate(), e && (this.interval = setInterval(function () {
                i._interpolate(!0)
            }, 500)), t.addClass(this.link, n), this.container.style.display = "", this.fire("show");
            if (s && !e) try {
                s.focus()
            } catch (o) {}
        },
        hide: function () {
            clearInterval(this.interval), this.elementToChange = null, t.removeClass(this.link, n), this.container.style.display = "none", this.fire("hide")
        }
    })
}(wysihtml5),
function (e) {
    var t = e.dom,
        n = {
            position: "relative"
        }, r = {
            left: 0,
            margin: 0,
            opacity: 0,
            overflow: "hidden",
            padding: 0,
            position: "absolute",
            top: 0,
            zIndex: 1
        }, i = {
            cursor: "inherit",
            fontSize: "50px",
            height: "50px",
            marginTop: "-25px",
            outline: 0,
            padding: 0,
            position: "absolute",
            right: "-4px",
            top: "50%"
        }, s = {
            "x-webkit-speech": "",
            speech: ""
        };
    e.toolbar.Speech = function (o, u) {
        var a = document.createElement("input");
        if (!e.browser.supportsSpeechApiOn(a)) {
            u.style.display = "none";
            return
        }
        var f = document.createElement("div");
        e.lang.object(r).merge({
            width: u.offsetWidth + "px",
            height: u.offsetHeight + "px"
        }), t.insert(a).into(f), t.insert(f).into(u), t.setStyles(i).on(a), t.setAttributes(s).on(a), t.setStyles(r).on(f), t.setStyles(n).on(u);
        var l = "onwebkitspeechchange" in a ? "webkitspeechchange" : "speechchange";
        t.observe(a, l, function () {
            o.execCommand("insertText", a.value), a.value = ""
        }), t.observe(a, "click", function (e) {
            t.hasClass(u, "wysihtml5-command-disabled") && e.preventDefault(), e.stopPropagation()
        })
    }
}(wysihtml5),
function (e) {
    var t = "wysihtml5-command-disabled",
        n = "wysihtml5-commands-disabled",
        r = "wysihtml5-command-active",
        i = "wysihtml5-action-active",
        s = e.dom;
    e.toolbar.Toolbar = Base.extend({
        constructor: function (t, n) {
            this.editor = t, this.container = typeof n == "string" ? document.getElementById(n) : n, this.composer = t.composer, this._getLinks("command"), this._getLinks("action"), this._observe(), this.show();
            var r = this.container.querySelectorAll("[data-wysihtml5-command=insertSpeech]"),
                i = r.length,
                s = 0;
            for (; s < i; s++) new e.toolbar.Speech(this, r[s])
        },
        _getLinks: function (t) {
            var n = this[t + "Links"] = e.lang.array(this.container.querySelectorAll("[data-wysihtml5-" + t + "]")).get(),
                r = n.length,
                i = 0,
                s = this[t + "Mapping"] = {}, o, u, a, f, l;
            for (; i < r; i++) o = n[i], a = o.getAttribute("data-wysihtml5-" + t), f = o.getAttribute("data-wysihtml5-" + t + "-value"), u = this.container.querySelector("[data-wysihtml5-" + t + "-group='" + a + "']"), l = this._getDialog(o, a), s[a + ":" + f] = {
                link: o,
                group: u,
                name: a,
                value: f,
                dialog: l,
                state: !1
            }
        },
        _getDialog: function (t, n) {
            var r = this,
                i = this.container.querySelector("[data-wysihtml5-dialog='" + n + "']"),
                s, o;
            return i && (s = new e.toolbar.Dialog(t, i), s.observe("show", function () {
                o = r.composer.selection.getBookmark(), r.editor.fire("show:dialog", {
                    command: n,
                    dialogContainer: i,
                    commandLink: t
                })
            }), s.observe("save", function (e) {
                o && r.composer.selection.setBookmark(o), r._execCommand(n, e), r.editor.fire("save:dialog", {
                    command: n,
                    dialogContainer: i,
                    commandLink: t
                })
            }), s.observe("cancel", function () {
                r.editor.focus(!1), r.editor.fire("cancel:dialog", {
                    command: n,
                    dialogContainer: i,
                    commandLink: t
                })
            })), s
        },
        execCommand: function (e, t) {
            if (this.commandsDisabled) return;
            var n = this.commandMapping[e + ":" + t];
            n && n.dialog && !n.state ? n.dialog.show() : this._execCommand(e, t)
        },
        _execCommand: function (e, t) {
            this.editor.focus(!1), this.composer.commands.exec(e, t), this._updateLinkStates()
        },
        execAction: function (e) {
            var t = this.editor;
            switch (e) {
            case "change_view":
                t.currentView === t.textarea ? t.fire("change_view", "composer") : t.fire("change_view", "textarea")
            }
        },
        _observe: function () {
            var e = this,
                t = this.editor,
                r = this.container,
                i = this.commandLinks.concat(this.actionLinks),
                o = i.length,
                u = 0;
            for (; u < o; u++) s.setAttributes({
                href: "javascript:;",
                unselectable: "on"
            }).on(i[u]);
            s.delegate(r, "[data-wysihtml5-command]", "mousedown", function (e) {
                e.preventDefault()
            }), s.delegate(r, "[data-wysihtml5-command]", "click", function (t) {
                var n = this,
                    r = n.getAttribute("data-wysihtml5-command"),
                    i = n.getAttribute("data-wysihtml5-command-value");
                e.execCommand(r, i), t.preventDefault()
            }), s.delegate(r, "[data-wysihtml5-action]", "click", function (t) {
                var n = this.getAttribute("data-wysihtml5-action");
                e.execAction(n), t.preventDefault()
            }), t.observe("focus:composer", function () {
                e.bookmark = null, clearInterval(e.interval), e.interval = setInterval(function () {
                    e._updateLinkStates()
                }, 500)
            }), t.observe("blur:composer", function () {
                clearInterval(e.interval)
            }), t.observe("destroy:composer", function () {
                clearInterval(e.interval)
            }), t.observe("change_view", function (t) {
                setTimeout(function () {
                    e.commandsDisabled = t !== "composer", e._updateLinkStates(), e.commandsDisabled ? s.addClass(r, n) : s.removeClass(r, n)
                }, 0)
            })
        },
        _updateLinkStates: function () {
            var n = this.composer.element,
                o = this.commandMapping,
                u = this.actionMapping,
                a, f, l, c;
            for (a in o) {
                c = o[a], this.commandsDisabled ? (f = !1, s.removeClass(c.link, r), c.group && s.removeClass(c.group, r), c.dialog && c.dialog.hide()) : (f = this.composer.commands.state(c.name, c.value), e.lang.object(f).isArray() && (f = f.length === 1 ? f[0] : !0), s.removeClass(c.link, t), c.group && s.removeClass(c.group, t));
                if (c.state === f) continue;
                c.state = f, f ? (s.addClass(c.link, r), c.group && s.addClass(c.group, r), c.dialog && (typeof f == "object" ? c.dialog.show(f) : c.dialog.hide())) : (s.removeClass(c.link, r), c.group && s.removeClass(c.group, r), c.dialog && c.dialog.hide())
            }
            for (a in u) l = u[a], l.name === "change_view" && (l.state = this.editor.currentView === this.editor.textarea, l.state ? s.addClass(l.link, i) : s.removeClass(l.link, i))
        },
        show: function () {
            this.container.style.display = ""
        },
        hide: function () {
            this.container.style.display = "none"
        }
    })
}(wysihtml5),
function (e) {
    var t, n = {
            name: t,
            style: !0,
            toolbar: t,
            autoLink: !0,
            parserRules: {
                tags: {
                    br: {},
                    span: {},
                    div: {},
                    p: {}
                },
                classes: {}
            },
            parser: e.dom.parse,
            composerClassName: "wysihtml5-editor",
            bodyClassName: "wysihtml5-supported",
            stylesheets: [],
            placeholderText: t,
            allowObjectResizing: !0,
            supportTouchDevices: !0
        };
    e.Editor = e.lang.Dispatcher.extend({
        constructor: function (t, r) {
            this.textareaElement = typeof t == "string" ? document.getElementById(t) : t, this.config = e.lang.object({}).merge(n).merge(r).get(), this.textarea = new e.views.Textarea(this, this.textareaElement, this.config), this.currentView = this.textarea, this._isCompatible = e.browser.supported();
            if (!this._isCompatible || !this.config.supportTouchDevices && e.browser.isTouchDevice()) {
                var i = this;
                setTimeout(function () {
                    i.fire("beforeload").fire("load")
                }, 0);
                return
            }
            e.dom.addClass(document.body, this.config.bodyClassName), this.composer = new e.views.Composer(this, this.textareaElement, this.config), this.currentView = this.composer, typeof this.config.parser == "function" && this._initParser(), this.observe("beforeload", function () {
                this.synchronizer = new e.views.Synchronizer(this, this.textarea, this.composer), this.config.toolbar && (this.toolbar = new e.toolbar.Toolbar(this, this.config.toolbar))
            });
            try {
                console.log("Heya! This page is using wysihtml5 for rich text editing. Check out https://github.com/xing/wysihtml5")
            } catch (s) {}
        },
        isCompatible: function () {
            return this._isCompatible
        },
        clear: function () {
            return this.currentView.clear(), this
        },
        getValue: function (e) {
            return this.currentView.getValue(e)
        },
        setValue: function (e, t) {
            return e ? (this.currentView.setValue(e, t), this) : this.clear()
        },
        focus: function (e) {
            return this.currentView.focus(e), this
        },
        disable: function () {
            return this.currentView.disable(), this
        },
        enable: function () {
            return this.currentView.enable(), this
        },
        isEmpty: function () {
            return this.currentView.isEmpty()
        },
        hasPlaceholderSet: function () {
            return this.currentView.hasPlaceholderSet()
        },
        parse: function (t) {
            var n = this.config.parser(t, this.config.parserRules, this.composer.sandbox.getDocument(), !0);
            return typeof t == "object" && e.quirks.redraw(t), n
        },
        _initParser: function () {
            this.observe("paste:composer", function () {
                var t = !0,
                    n = this;
                n.composer.selection.executeAndRestore(function () {
                    e.quirks.cleanPastedHTML(n.composer.element), n.parse(n.composer.element)
                }, t)
            }), this.observe("paste:textarea", function () {
                var e = this.textarea.getValue(),
                    t;
                t = this.parse(e), this.textarea.setValue(t)
            })
        }
    })
}(wysihtml5), ! function (e, t) {
    "use strict";
    var n = {
        "font-styles": function (e, t) {
            var n = t && t.size ? " btn-" + t.size : "";
            return "<li class='dropdown'><a class='btn btn-default dropdown-toggle" + n + "' data-toggle='dropdown' href='#'>" + "<i class='icon-font'></i>&nbsp;<span class='current-font'>" + e.font_styles.normal + "</span>&nbsp;<b class='caret'></b>" + "</a>" + "<ul class='dropdown-menu'>" + "<li><a data-wysihtml5-command='formatBlock' data-wysihtml5-command-value='div' tabindex='-1'>" + e.font_styles.normal + "</a></li>" + "<li><a data-wysihtml5-command='formatBlock' data-wysihtml5-command-value='h1' tabindex='-1'>" + e.font_styles.h1 + "</a></li>" + "<li><a data-wysihtml5-command='formatBlock' data-wysihtml5-command-value='h2' tabindex='-1'>" + e.font_styles.h2 + "</a></li>" + "<li><a data-wysihtml5-command='formatBlock' data-wysihtml5-command-value='h3' tabindex='-1'>" + e.font_styles.h3 + "</a></li>" + "</ul>" + "</li>"
        },
        emphasis: function (e, t) {
            var n = t && t.size ? " btn-" + t.size : "";
            return "<li><div class='btn-group'><a class='btn btn-default" + n + "' data-wysihtml5-command='bold' title='CTRL+B' tabindex='-1'>" + e.emphasis.bold + "</a>" + "<a class='btn btn-default" + n + "' data-wysihtml5-command='italic' title='CTRL+I' tabindex='-1'>" + e.emphasis.italic + "</a>" + "<a class='btn btn-default" + n + "' data-wysihtml5-command='underline' title='CTRL+U' tabindex='-1'>" + e.emphasis.underline + "</a>" + "</div>" + "</li>"
        },
        lists: function (e, t) {
            var n = t && t.size ? " btn-" + t.size : "";
            return "<li><div class='btn-group'><a class='btn btn-default" + n + "' data-wysihtml5-command='insertUnorderedList' title='" + e.lists.unordered + "' tabindex='-1'><i class='icon-list'></i></a>" + "<a class='btn btn-default" + n + "' data-wysihtml5-command='insertOrderedList' title='" + e.lists.ordered + "' tabindex='-1'><i class='icon-th-list'></i></a>" + "<a class='btn btn-default" + n + "' data-wysihtml5-command='Outdent' title='" + e.lists.outdent + "' tabindex='-1'><i class='icon-indent-right'></i></a>" + "<a class='btn btn-default" + n + "' data-wysihtml5-command='Indent' title='" + e.lists.indent + "' tabindex='-1'><i class='icon-indent-left'></i></a>" + "</div>" + "</li>"
        },
        link: function (e, t) {
            var n = t && t.size ? " btn-" + t.size : "";
            return "<li><div class='bootstrap-wysihtml5-insert-link-modal modal hide fade'><div class='modal-header'><a class='close' data-dismiss='modal'>&times;</a><h3>" + e.link.insert + "</h3>" + "</div>" + "<div class='modal-body'>" + "<input value='http://' class='bootstrap-wysihtml5-insert-link-url input-xlarge'>" + "</div>" + "<div class='modal-footer'>" + "<a href='#' class='btn btn-default' data-dismiss='modal'>" + e.link.cancel + "</a>" + "<a href='#' class='btn btn-blue' data-dismiss='modal'>" + e.link.insert + "</a>" + "</div>" + "</div>" + "<a class='btn btn-default" + n + "' data-wysihtml5-command='createLink' title='" + e.link.insert + "' tabindex='-1'><i class='icon-share'></i></a>" + "</li>"
        },
        image: function (e, t) {
            var n = t && t.size ? " btn-" + t.size : "";
            return "<li><div class='bootstrap-wysihtml5-insert-image-modal modal hide fade'><div class='modal-header'><a class='close' data-dismiss='modal'>&times;</a><h3>" + e.image.insert + "</h3>" + "</div>" + "<div class='modal-body'>" + "<input value='http://' class='bootstrap-wysihtml5-insert-image-url input-xlarge'>" + "</div>" + "<div class='modal-footer'>" + "<a href='#' class='btn btn-default' data-dismiss='modal'>" + e.image.cancel + "</a>" + "<a href='#' class='btn btn-blue' data-dismiss='modal'>" + e.image.insert + "</a>" + "</div>" + "</div>" + "<a class='btn btn-default" + n + "' data-wysihtml5-command='insertImage' title='" + e.image.insert + "' tabindex='-1'><i class='icon-picture'></i></a>" + "</li>"
        },
        html: function (e, t) {
            var n = t && t.size ? " btn-" + t.size : "";
            return "<li><div class='btn-group'><a class='btn btn-default" + n + "' data-wysihtml5-action='change_view' title='" + e.html.edit + "' tabindex='-1'><i class='icon-pencil'></i></a>" + "</div>" + "</li>"
        },
        color: function (e, t) {
            var n = t && t.size ? " btn-" + t.size : "";
            return "<li class='dropdown'><a class='btn btn-default dropdown-toggle" + n + "' data-toggle='dropdown' href='#' tabindex='-1'>" + "<span class='current-color'>" + e.colours.black + "</span>&nbsp;<b class='caret'></b>" + "</a>" + "<ul class='dropdown-menu'>" + "<li><div class='wysihtml5-colors' data-wysihtml5-command-value='black'></div><a class='wysihtml5-colors-title' data-wysihtml5-command='foreColor' data-wysihtml5-command-value='black'>" + e.colours.black + "</a></li>" + "<li><div class='wysihtml5-colors' data-wysihtml5-command-value='silver'></div><a class='wysihtml5-colors-title' data-wysihtml5-command='foreColor' data-wysihtml5-command-value='silver'>" + e.colours.silver + "</a></li>" + "<li><div class='wysihtml5-colors' data-wysihtml5-command-value='gray'></div><a class='wysihtml5-colors-title' data-wysihtml5-command='foreColor' data-wysihtml5-command-value='gray'>" + e.colours.gray + "</a></li>" + "<li><div class='wysihtml5-colors' data-wysihtml5-command-value='maroon'></div><a class='wysihtml5-colors-title' data-wysihtml5-command='foreColor' data-wysihtml5-command-value='maroon'>" + e.colours.maroon + "</a></li>" + "<li><div class='wysihtml5-colors' data-wysihtml5-command-value='red'></div><a class='wysihtml5-colors-title' data-wysihtml5-command='foreColor' data-wysihtml5-command-value='red'>" + e.colours.red + "</a></li>" + "<li><div class='wysihtml5-colors' data-wysihtml5-command-value='purple'></div><a class='wysihtml5-colors-title' data-wysihtml5-command='foreColor' data-wysihtml5-command-value='purple'>" + e.colours.purple + "</a></li>" + "<li><div class='wysihtml5-colors' data-wysihtml5-command-value='green'></div><a class='wysihtml5-colors-title' data-wysihtml5-command='foreColor' data-wysihtml5-command-value='green'>" + e.colours.green + "</a></li>" + "<li><div class='wysihtml5-colors' data-wysihtml5-command-value='olive'></div><a class='wysihtml5-colors-title' data-wysihtml5-command='foreColor' data-wysihtml5-command-value='olive'>" + e.colours.olive + "</a></li>" + "<li><div class='wysihtml5-colors' data-wysihtml5-command-value='navy'></div><a class='wysihtml5-colors-title' data-wysihtml5-command='foreColor' data-wysihtml5-command-value='navy'>" + e.colours.navy + "</a></li>" + "<li><div class='wysihtml5-colors' data-wysihtml5-command-value='blue'></div><a class='wysihtml5-colors-title' data-wysihtml5-command='foreColor' data-wysihtml5-command-value='blue'>" + e.colours.blue + "</a></li>" + "<li><div class='wysihtml5-colors' data-wysihtml5-command-value='orange'></div><a class='wysihtml5-colors-title' data-wysihtml5-command='foreColor' data-wysihtml5-command-value='orange'>" + e.colours.orange + "</a></li>" + "</ul>" + "</li>"
        }
    }, r = function (e, t, r) {
            return n[e](t, r)
        }, i = function (t, r) {
            this.el = t;
            var i = r || o;
            for (var s in i.customTemplates) n[s] = i.customTemplates[s];
            this.toolbar = this.createToolbar(t, i), this.editor = this.createEditor(r), window.editor = this.editor, e("iframe.wysihtml5-sandbox").each(function (t, n) {
                e(n.contentWindow).off("focus.wysihtml5").on({
                    "focus.wysihtml5": function () {
                        e("li.dropdown").removeClass("open")
                    }
                })
            })
        };
    i.prototype = {
        constructor: i,
        createEditor: function (n) {
            n = n || {}, n = e.extend(!0, {}, n), n.toolbar = this.toolbar[0];
            var r = new t.Editor(this.el[0], n);
            if (n && n.events)
                for (var i in n.events) r.on(i, n.events[i]);
            return r
        },
        createToolbar: function (t, n) {
            var i = this,
                s = e("<ul/>", {
                    "class": "wysihtml5-toolbar",
                    style: "display:none"
                }),
                a = n.locale || o.locale || "en";
            for (var f in o) {
                var l = !1;
                n[f] !== undefined ? n[f] === !0 && (l = !0) : l = o[f], l === !0 && (s.append(r(f, u[a], n)), f === "html" && this.initHtml(s), f === "link" && this.initInsertLink(s), f === "image" && this.initInsertImage(s))
            }
            if (n.toolbar)
                for (f in n.toolbar) s.append(n.toolbar[f]);
            return s.find("a[data-wysihtml5-command='formatBlock']").click(function (t) {
                var n = t.target || t.srcElement,
                    r = e(n);
                i.toolbar.find(".current-font").text(r.html())
            }), s.find("a[data-wysihtml5-command='foreColor']").click(function (t) {
                var n = t.target || t.srcElement,
                    r = e(n);
                i.toolbar.find(".current-color").text(r.html())
            }), this.el.before(s), s
        },
        initHtml: function (e) {
            var t = "a[data-wysihtml5-action='change_view']";
            e.find(t).click(function (n) {
                e.find("a.btn").not(t).toggleClass("disabled")
            })
        },
        initInsertImage: function (t) {
            var n = this,
                r = t.find(".bootstrap-wysihtml5-insert-image-modal"),
                i = r.find(".bootstrap-wysihtml5-insert-image-url"),
                s = r.find("a.btn-blue"),
                o = i.val(),
                u, a = function () {
                    var e = i.val();
                    i.val(o), n.editor.currentView.element.focus(), u && (n.editor.composer.selection.setBookmark(u), u = null), n.editor.composer.commands.exec("insertImage", e)
                };
            i.keypress(function (e) {
                e.which == 13 && (a(), r.modal("hide"))
            }), s.click(a), r.on("shown", function () {
                i.focus()
            }), r.on("hide", function () {
                n.editor.currentView.element.focus()
            }), t.find("a[data-wysihtml5-command=insertImage]").click(function () {
                var t = e(this).hasClass("wysihtml5-command-active");
                return t ? !0 : (n.editor.currentView.element.focus(!1), u = n.editor.composer.selection.getBookmark(), r.appendTo("body").modal("show"), r.on("click.dismiss.modal", '[data-dismiss="modal"]', function (e) {
                    e.stopPropagation()
                }), !1)
            })
        },
        initInsertLink: function (t) {
            var n = this,
                r = t.find(".bootstrap-wysihtml5-insert-link-modal"),
                i = r.find(".bootstrap-wysihtml5-insert-link-url"),
                s = r.find("a.btn-blue"),
                o = i.val(),
                u, a = function () {
                    var e = i.val();
                    i.val(o), n.editor.currentView.element.focus(), u && (n.editor.composer.selection.setBookmark(u), u = null), n.editor.composer.commands.exec("createLink", {
                        href: e,
                        target: "_blank",
                        rel: "nofollow"
                    })
                }, f = !1;
            i.keypress(function (e) {
                e.which == 13 && (a(), r.modal("hide"))
            }), s.click(a), r.on("shown", function () {
                i.focus()
            }), r.on("hide", function () {
                n.editor.currentView.element.focus()
            }), t.find("a[data-wysihtml5-command=createLink]").click(function () {
                var t = e(this).hasClass("wysihtml5-command-active");
                return t ? !0 : (n.editor.currentView.element.focus(!1), u = n.editor.composer.selection.getBookmark(), r.appendTo("body").modal("show"), r.on("click.dismiss.modal", '[data-dismiss="modal"]', function (e) {
                    e.stopPropagation()
                }), !1)
            })
        }
    };
    var s = {
        resetDefaults: function () {
            e.fn.wysihtml5.defaultOptions = e.extend(!0, {}, e.fn.wysihtml5.defaultOptionsCache)
        },
        bypassDefaults: function (t) {
            return this.each(function () {
                var n = e(this);
                n.data("wysihtml5", new i(n, t))
            })
        },
        shallowExtend: function (t) {
            var n = e.extend({}, e.fn.wysihtml5.defaultOptions, t || {}),
                r = this;
            return s.bypassDefaults.apply(r, [n])
        },
        deepExtend: function (t) {
            var n = e.extend(!0, {}, e.fn.wysihtml5.defaultOptions, t || {}),
                r = this;
            return s.bypassDefaults.apply(r, [n])
        },
        init: function (e) {
            var t = this;
            return s.shallowExtend.apply(t, [e])
        }
    };
    e.fn.wysihtml5 = function (t) {
        if (s[t]) return s[t].apply(this, Array.prototype.slice.call(arguments, 1));
        if (typeof t == "object" || !t) return s.init.apply(this, arguments);
        e.error("Method " + t + " does not exist on jQuery.wysihtml5")
    }, e.fn.wysihtml5.Constructor = i;
    var o = e.fn.wysihtml5.defaultOptions = {
        "font-styles": !0,
        color: !1,
        emphasis: !0,
        lists: !0,
        html: !1,
        link: !0,
        image: !0,
        events: {},
        parserRules: {
            classes: {
                "wysiwyg-color-silver": 1,
                "wysiwyg-color-gray": 1,
                "wysiwyg-color-white": 1,
                "wysiwyg-color-maroon": 1,
                "wysiwyg-color-red": 1,
                "wysiwyg-color-purple": 1,
                "wysiwyg-color-fuchsia": 1,
                "wysiwyg-color-green": 1,
                "wysiwyg-color-lime": 1,
                "wysiwyg-color-olive": 1,
                "wysiwyg-color-yellow": 1,
                "wysiwyg-color-navy": 1,
                "wysiwyg-color-blue": 1,
                "wysiwyg-color-teal": 1,
                "wysiwyg-color-aqua": 1,
                "wysiwyg-color-orange": 1
            },
            tags: {
                b: {},
                i: {},
                br: {},
                ol: {},
                ul: {},
                li: {},
                h1: {},
                h2: {},
                h3: {},
                blockquote: {},
                u: 1,
                img: {
                    check_attributes: {
                        width: "numbers",
                        alt: "alt",
                        src: "url",
                        height: "numbers"
                    }
                },
                a: {
                    set_attributes: {
                        target: "_blank",
                        rel: "nofollow"
                    },
                    check_attributes: {
                        href: "url"
                    }
                },
                span: 1,
                div: 1,
                code: 1,
                pre: 1
            }
        },
        stylesheets: ["./lib/css/wysiwyg-color.css"],
        locale: "en"
    };
    typeof e.fn.wysihtml5.defaultOptionsCache == "undefined" && (e.fn.wysihtml5.defaultOptionsCache = e.extend(!0, {}, e.fn.wysihtml5.defaultOptions));
    var u = e.fn.wysihtml5.locale = {
        en: {
            font_styles: {
                normal: "Normal text",
                h1: "Heading 1",
                h2: "Heading 2",
                h3: "Heading 3"
            },
            emphasis: {
                bold: "Bold",
                italic: "Italic",
                underline: "Underline"
            },
            lists: {
                unordered: "Unordered list",
                ordered: "Ordered list",
                outdent: "Outdent",
                indent: "Indent"
            },
            link: {
                insert: "Insert link",
                cancel: "Cancel"
            },
            image: {
                insert: "Insert image",
                cancel: "Cancel"
            },
            html: {
                edit: "Edit HTML"
            },
            colours: {
                black: "Black",
                silver: "Silver",
                gray: "Grey",
                maroon: "Maroon",
                red: "Red",
                purple: "Purple",
                green: "Green",
                olive: "Olive",
                navy: "Navy",
                blue: "Blue",
                orange: "Orange"
            }
        }
    }
}(window.jQuery, window.wysihtml5),
function (e) {
    var t = "0.3.4",
        n = "hasOwnProperty",
        r = /[\.\/]/,
        i = "*",
        s = function () {}, o = function (e, t) {
            return e - t
        }, u, a, f = {
            n: {}
        }, l = function (e, t) {
            var n = f,
                r = a,
                i = Array.prototype.slice.call(arguments, 2),
                s = l.listeners(e),
                c = 0,
                p = !1,
                d, v = [],
                m = {}, y = [],
                b = u,
                w = [];
            u = e, a = 0;
            for (var E = 0, S = s.length; E < S; E++) "zIndex" in s[E] && (v.push(s[E].zIndex), s[E].zIndex < 0 && (m[s[E].zIndex] = s[E]));
            v.sort(o);
            while (v[c] < 0) {
                d = m[v[c++]], y.push(d.apply(t, i));
                if (a) return a = r, y
            }
            for (E = 0; E < S; E++) {
                d = s[E];
                if ("zIndex" in d)
                    if (d.zIndex == v[c]) {
                        y.push(d.apply(t, i));
                        if (a) break;
                        do {
                            c++, d = m[v[c]], d && y.push(d.apply(t, i));
                            if (a) break
                        } while (d)
                    } else m[d.zIndex] = d;
                    else {
                        y.push(d.apply(t, i));
                        if (a) break
                    }
            }
            return a = r, u = b, y.length ? y : null
        };
    l.listeners = function (e) {
        var t = e.split(r),
            n = f,
            s, o, u, a, l, c, h, p, v = [n],
            m = [];
        for (a = 0, l = t.length; a < l; a++) {
            p = [];
            for (c = 0, h = v.length; c < h; c++) {
                n = v[c].n, o = [n[t[a]], n[i]], u = 2;
                while (u--) s = o[u], s && (p.push(s), m = m.concat(s.f || []))
            }
            v = p
        }
        return m
    }, l.on = function (e, t) {
        var n = e.split(r),
            i = f;
        for (var o = 0, u = n.length; o < u; o++) i = i.n, !i[n[o]] && (i[n[o]] = {
            n: {}
        }), i = i[n[o]];
        i.f = i.f || [];
        for (o = 0, u = i.f.length; o < u; o++)
            if (i.f[o] == t) return s;
        return i.f.push(t),
        function (e) {
            +e == +e && (t.zIndex = +e)
        }
    }, l.stop = function () {
        a = 1
    }, l.nt = function (e) {
        return e ? (new RegExp("(?:\\.|\\/|^)" + e + "(?:\\.|\\/|$)")).test(u) : u
    }, l.off = l.unbind = function (e, t) {
        var s = e.split(r),
            o, u, a, l, h, p, v, m = [f];
        for (l = 0, h = s.length; l < h; l++)
            for (p = 0; p < m.length; p += a.length - 2) {
                a = [p, 1], o = m[p].n;
                if (s[l] != i) o[s[l]] && a.push(o[s[l]]);
                else
                    for (u in o) o[n](u) && a.push(o[u]);
                m.splice.apply(m, a)
            }
        for (l = 0, h = m.length; l < h; l++) {
            o = m[l];
            while (o.n) {
                if (t) {
                    if (o.f) {
                        for (p = 0, v = o.f.length; p < v; p++)
                            if (o.f[p] == t) {
                                o.f.splice(p, 1);
                                break
                            }!o.f.length && delete o.f
                    }
                    for (u in o.n)
                        if (o.n[n](u) && o.n[u].f) {
                            var g = o.n[u].f;
                            for (p = 0, v = g.length; p < v; p++)
                                if (g[p] == t) {
                                    g.splice(p, 1);
                                    break
                                }!g.length && delete o.n[u].f
                        }
                } else {
                    delete o.f;
                    for (u in o.n) o.n[n](u) && o.n[u].f && delete o.n[u].f
                }
                o = o.n
            }
        }
    }, l.once = function (e, t) {
        var n = function () {
            var r = t.apply(this, arguments);
            return l.unbind(e, n), r
        };
        return l.on(e, n)
    }, l.version = t, l.toString = function () {
        return "You are running Eve " + t
    }, typeof module != "undefined" && module.exports ? module.exports = l : typeof define != "undefined" ? define("eve", [], function () {
        return l
    }) : e.eve = l
}(this),
function () {
    function e(e) {
        for (var t = 0; t < An.length; t++) An[t].el.paper == e && An.splice(t--, 1)
    }

    function t(e, t, n, i, s, u) {
        n = at(n);
        var a, f, l, c = [],
            h, p, d, v = e.ms,
            m = {}, g = {}, y = {};
        if (i)
            for (E = 0, x = An.length; E < x; E++) {
                var b = An[E];
                if (b.el.id == t.id && b.anim == e) {
                    b.percent != n ? (An.splice(E, 1), l = 1) : f = b, t.attr(b.totalOrigin);
                    break
                }
            } else i = +g;
        for (var E = 0, x = e.percents.length; E < x; E++) {
            if (e.percents[E] == n || e.percents[E] > i * e.top) {
                n = e.percents[E], p = e.percents[E - 1] || 0, v = v / e.top * (n - p), h = e.percents[E + 1], a = e.anim[n];
                break
            }
            i && t.attr(e.anim[e.percents[E]])
        }
        if ( !! a) {
            if (!f) {
                for (var T in a)
                    if (a[C](T))
                        if (ht[C](T) || t.paper.customAttributes[C](T)) {
                            m[T] = t.attr(T), m[T] == null && (m[T] = ct[T]), g[T] = a[T];
                            switch (ht[T]) {
                            case J:
                                y[T] = (g[T] - m[T]) / v;
                                break;
                            case "colour":
                                m[T] = w.getRGB(m[T]);
                                var N = w.getRGB(g[T]);
                                y[T] = {
                                    r: (N.r - m[T].r) / v,
                                    g: (N.g - m[T].g) / v,
                                    b: (N.b - m[T].b) / v
                                };
                                break;
                            case "path":
                                var k = Qt(m[T], g[T]),
                                    L = k[1];
                                m[T] = k[0], y[T] = [];
                                for (E = 0, x = m[T].length; E < x; E++) {
                                    y[T][E] = [0];
                                    for (var A = 1, O = m[T][E].length; A < O; A++) y[T][E][A] = (L[E][A] - m[T][E][A]) / v
                                }
                                break;
                            case "transform":
                                var M = t._,
                                    _ = an(M[T], g[T]);
                                if (_) {
                                    m[T] = _.from, g[T] = _.to, y[T] = [], y[T].real = !0;
                                    for (E = 0, x = m[T].length; E < x; E++) {
                                        y[T][E] = [m[T][E][0]];
                                        for (A = 1, O = m[T][E].length; A < O; A++) y[T][E][A] = (g[T][E][A] - m[T][E][A]) / v
                                    }
                                } else {
                                    var P = t.matrix || new o,
                                        H = {
                                            _: {
                                                transform: M.transform
                                            },
                                            getBBox: function () {
                                                return t.getBBox(1)
                                            }
                                        };
                                    m[T] = [P.a, P.b, P.c, P.d, P.e, P.f], on(H, g[T]), g[T] = H._.transform, y[T] = [(H.matrix.a - P.a) / v, (H.matrix.b - P.b) / v, (H.matrix.c - P.c) / v, (H.matrix.d - P.d) / v, (H.matrix.e - P.e) / v, (H.matrix.f - P.f) / v]
                                }
                                break;
                            case "csv":
                                var B = j(a[T])[F](S),
                                    I = j(m[T])[F](S);
                                if (T == "clip-rect") {
                                    m[T] = I, y[T] = [], E = I.length;
                                    while (E--) y[T][E] = (B[E] - m[T][E]) / v
                                }
                                g[T] = B;
                                break;
                            default:
                                B = [][D](a[T]), I = [][D](m[T]), y[T] = [], E = t.paper.customAttributes[T].length;
                                while (E--) y[T][E] = ((B[E] || 0) - (I[E] || 0)) / v
                            }
                        }
                var q = a.easing,
                    R = w.easing_formulas[q];
                if (!R) {
                    R = j(q).match(st);
                    if (R && R.length == 5) {
                        var U = R;
                        R = function (e) {
                            return r(e, +U[1], +U[2], +U[3], +U[4], v)
                        }
                    } else R = Nt
                }
                d = a.start || e.start || +(new Date), b = {
                    anim: e,
                    percent: n,
                    timestamp: d,
                    start: d + (e.del || 0),
                    status: 0,
                    initstatus: i || 0,
                    stop: !1,
                    ms: v,
                    easing: R,
                    from: m,
                    diff: y,
                    to: g,
                    el: t,
                    callback: a.callback,
                    prev: p,
                    next: h,
                    repeat: u || e.times,
                    origin: t.attr(),
                    totalOrigin: s
                }, An.push(b);
                if (i && !f && !l) {
                    b.stop = !0, b.start = new Date - v * i;
                    if (An.length == 1) return Mn()
                }
                l && (b.start = new Date - b.ms * i), An.length == 1 && On(Mn)
            } else f.initstatus = i, f.start = new Date - f.ms * i;
            eve("raphael.anim.start." + t.id, t, e)
        }
    }

    function n(e, t) {
        var n = [],
            r = {};
        this.ms = t, this.times = 1;
        if (e) {
            for (var i in e) e[C](i) && (r[at(i)] = e[i], n.push(at(i)));
            n.sort(xt)
        }
        this.anim = r, this.top = n[n.length - 1], this.percents = n
    }

    function r(e, t, n, r, i, s) {
        function o(e, t) {
            var n, r, i, s, o, u;
            for (i = e, u = 0; u < 8; u++) {
                s = a(i) - e;
                if (X(s) < t) return i;
                o = (3 * c * i + 2 * l) * i + f;
                if (X(o) < 1e-6) break;
                i -= s / o
            }
            n = 0, r = 1, i = e;
            if (i < n) return n;
            if (i > r) return r;
            while (n < r) {
                s = a(i);
                if (X(s - e) < t) return i;
                e > s ? n = i : r = i, i = (r - n) / 2 + n
            }
            return i
        }

        function u(e, t) {
            var n = o(e, t);
            return ((d * n + p) * n + h) * n
        }

        function a(e) {
            return ((c * e + l) * e + f) * e
        }
        var f = 3 * t,
            l = 3 * (r - t) - f,
            c = 1 - f - l,
            h = 3 * n,
            p = 3 * (i - n) - h,
            d = 1 - h - p;
        return u(e, 1 / (200 * s))
    }

    function i() {
        return this.x + B + this.y + B + this.width + "  " + this.height
    }

    function s() {
        return this.x + B + this.y
    }

    function o(e, t, n, r, i, s) {
        e != null ? (this.a = +e, this.b = +t, this.c = +n, this.d = +r, this.e = +i, this.f = +s) : (this.a = 1, this.b = 0, this.c = 0, this.d = 1, this.e = 0, this.f = 0)
    }

    function u(e, t, n) {
        e = w._path2curve(e), t = w._path2curve(t);
        var r, i, s, o, u, f, l, c, h, p, d = n ? 0 : [];
        for (var v = 0, m = e.length; v < m; v++) {
            var g = e[v];
            if (g[0] == "M") r = u = g[1], i = f = g[2];
            else {
                g[0] == "C" ? (h = [r, i].concat(g.slice(1)), r = h[6], i = h[7]) : (h = [r, i, r, i, u, f, u, f], r = u, i = f);
                for (var y = 0, b = t.length; y < b; y++) {
                    var E = t[y];
                    if (E[0] == "M") s = l = E[1], o = c = E[2];
                    else {
                        E[0] == "C" ? (p = [s, o].concat(E.slice(1)), s = p[6], o = p[7]) : (p = [s, o, s, o, l, c, l, c], s = l, o = c);
                        var S = a(h, p, n);
                        if (n) d += S;
                        else {
                            for (var x = 0, T = S.length; x < T; x++) S[x].segment1 = v, S[x].segment2 = y, S[x].bez1 = h, S[x].bez2 = p;
                            d = d.concat(S)
                        }
                    }
                }
            }
        }
        return d
    }

    function a(e, t, n) {
        var r = w.bezierBBox(e),
            i = w.bezierBBox(t);
        if (!w.isBBoxIntersect(r, i)) return n ? 0 : [];
        var s = p.apply(0, e),
            o = p.apply(0, t),
            u = ~~ (s / 5),
            a = ~~ (o / 5),
            f = [],
            l = [],
            h = {}, d = n ? 0 : [];
        for (var v = 0; v < u + 1; v++) {
            var m = w.findDotsAtSegment.apply(w, e.concat(v / u));
            f.push({
                x: m.x,
                y: m.y,
                t: v / u
            })
        }
        for (v = 0; v < a + 1; v++) m = w.findDotsAtSegment.apply(w, t.concat(v / a)), l.push({
            x: m.x,
            y: m.y,
            t: v / a
        });
        for (v = 0; v < u; v++)
            for (var g = 0; g < a; g++) {
                var y = f[v],
                    b = f[v + 1],
                    E = l[g],
                    S = l[g + 1],
                    x = X(b.x - y.x) < .001 ? "y" : "x",
                    T = X(S.x - E.x) < .001 ? "y" : "x",
                    N = c(y.x, y.y, b.x, b.y, E.x, E.y, S.x, S.y);
                if (N) {
                    if (h[N.x.toFixed(4)] == N.y.toFixed(4)) continue;
                    h[N.x.toFixed(4)] = N.y.toFixed(4);
                    var C = y.t + X((N[x] - y[x]) / (b[x] - y[x])) * (b.t - y.t),
                        k = E.t + X((N[T] - E[T]) / (S[T] - E[T])) * (S.t - E.t);
                    C >= 0 && C <= 1 && k >= 0 && k <= 1 && (n ? d++ : d.push({
                        x: N.x,
                        y: N.y,
                        t1: C,
                        t2: k
                    }))
                }
            }
        return d
    }

    function f(e, t) {
        return a(e, t, 1)
    }

    function l(e, t) {
        return a(e, t)
    }

    function c(e, t, n, r, i, s, o, u) {
        if (!(z(e, n) < W(i, o) || W(e, n) > z(i, o) || z(t, r) < W(s, u) || W(t, r) > z(s, u))) {
            var a = (e * r - t * n) * (i - o) - (e - n) * (i * u - s * o),
                f = (e * r - t * n) * (s - u) - (t - r) * (i * u - s * o),
                l = (e - n) * (s - u) - (t - r) * (i - o);
            if (!l) return;
            var c = a / l,
                h = f / l,
                p = +c.toFixed(2),
                d = +h.toFixed(2);
            if (p < +W(e, n).toFixed(2) || p > +z(e, n).toFixed(2) || p < +W(i, o).toFixed(2) || p > +z(i, o).toFixed(2) || d < +W(t, r).toFixed(2) || d > +z(t, r).toFixed(2) || d < +W(s, u).toFixed(2) || d > +z(s, u).toFixed(2)) return;
            return {
                x: c,
                y: h
            }
        }
    }

    function h(e, t, n, r, i, s, o, u, a) {
        if (!(a < 0 || p(e, t, n, r, i, s, o, u) < a)) {
            var f = 1,
                l = f / 2,
                c = f - l,
                h, d = .01;
            h = p(e, t, n, r, i, s, o, u, c);
            while (X(h - a) > d) l /= 2, c += (h < a ? 1 : -1) * l, h = p(e, t, n, r, i, s, o, u, c);
            return c
        }
    }

    function p(e, t, n, r, i, s, o, u, a) {
        a == null && (a = 1), a = a > 1 ? 1 : a < 0 ? 0 : a;
        var f = a / 2,
            l = 12,
            c = [-0.1252, .1252, -0.3678, .3678, -0.5873, .5873, -0.7699, .7699, -0.9041, .9041, -0.9816, .9816],
            h = [.2491, .2491, .2335, .2335, .2032, .2032, .1601, .1601, .1069, .1069, .0472, .0472],
            p = 0;
        for (var v = 0; v < l; v++) {
            var m = f * c[v] + f,
                g = d(m, e, n, i, o),
                y = d(m, t, r, s, u),
                b = g * g + y * y;
            p += h[v] * U.sqrt(b)
        }
        return f * p
    }

    function d(e, t, n, r, i) {
        var s = -3 * t + 9 * n - 9 * r + 3 * i,
            o = e * s + 6 * t - 12 * n + 6 * r;
        return e * o - 3 * t + 3 * n
    }

    function v(e, t) {
        var n = [];
        for (var r = 0, i = e.length; i - 2 * !t > r; r += 2) {
            var s = [{
                x: +e[r - 2],
                y: +e[r - 1]
            }, {
                x: +e[r],
                y: +e[r + 1]
            }, {
                x: +e[r + 2],
                y: +e[r + 3]
            }, {
                x: +e[r + 4],
                y: +e[r + 5]
            }];
            t ? r ? i - 4 == r ? s[3] = {
                x: +e[0],
                y: +e[1]
            } : i - 2 == r && (s[2] = {
                x: +e[0],
                y: +e[1]
            }, s[3] = {
                x: +e[2],
                y: +e[3]
            }) : s[0] = {
                x: +e[i - 2],
                y: +e[i - 1]
            } : i - 4 == r ? s[3] = s[2] : r || (s[0] = {
                x: +e[r],
                y: +e[r + 1]
            }), n.push(["C", (-s[0].x + 6 * s[1].x + s[2].x) / 6, (-s[0].y + 6 * s[1].y + s[2].y) / 6, (s[1].x + 6 * s[2].x - s[3].x) / 6, (s[1].y + 6 * s[2].y - s[3].y) / 6, s[2].x, s[2].y])
        }
        return n
    }

    function m() {
        return this.hex
    }

    function g(e, t, n) {
        function r() {
            var i = Array.prototype.slice.call(arguments, 0),
                s = i.join("?"),
                o = r.cache = r.cache || {}, u = r.count = r.count || [];
            return o[C](s) ? (y(u, s), n ? n(o[s]) : o[s]) : (u.length >= 1e3 && delete o[u.shift()], u.push(s), o[s] = e[_](t, i), n ? n(o[s]) : o[s])
        }
        return r
    }

    function y(e, t) {
        for (var n = 0, r = e.length; n < r; n++)
            if (e[n] === t) return e.push(e.splice(n, 1)[0])
    }

    function b(e) {
        if (Object(e) !== e) return e;
        var t = new e.constructor;
        for (var n in e) e[C](n) && (t[n] = b(e[n]));
        return t
    }

    function w(e) {
        if (w.is(e, "function")) return E ? e() : eve.on("raphael.DOMload", e);
        if (w.is(e, Q)) return w._engine.create[_](w, e.splice(0, 3 + w.is(e[0], J))).add(e);
        var t = Array.prototype.slice.call(arguments, 0);
        if (w.is(t[t.length - 1], "function")) {
            var n = t.pop();
            return E ? n.call(w._engine.create[_](w, t)) : eve.on("raphael.DOMload", function () {
                n.call(w._engine.create[_](w, t))
            })
        }
        return w._engine.create[_](w, arguments)
    }
    w.version = "2.1.0", w.eve = eve;
    var E, S = /[, ]+/,
        x = {
            circle: 1,
            rect: 1,
            path: 1,
            ellipse: 1,
            text: 1,
            image: 1
        }, T = /\{(\d+)\}/g,
        N = "prototype",
        C = "hasOwnProperty",
        k = {
            doc: document,
            win: window
        }, L = {
            was: Object.prototype[C].call(k.win, "Raphael"),
            is: k.win.Raphael
        }, A = function () {
            this.ca = this.customAttributes = {}
        }, O, M = "appendChild",
        _ = "apply",
        D = "concat",
        P = "createTouch" in k.doc,
        H = "",
        B = " ",
        j = String,
        F = "split",
        I = "click dblclick mousedown mousemove mouseout mouseover mouseup touchstart touchmove touchend touchcancel" [F](B),
        q = {
            mousedown: "touchstart",
            mousemove: "touchmove",
            mouseup: "touchend"
        }, R = j.prototype.toLowerCase,
        U = Math,
        z = U.max,
        W = U.min,
        X = U.abs,
        V = U.pow,
        $ = U.PI,
        J = "number",
        K = "string",
        Q = "array",
        G = "toString",
        Y = "fill",
        Z = Object.prototype.toString,
        et = {}, tt = "push",
        nt = w._ISURL = /^url\(['"]?([^\)]+?)['"]?\)$/i,
        rt = /^\s*((#[a-f\d]{6})|(#[a-f\d]{3})|rgba?\(\s*([\d\.]+%?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+%?)?)\s*\)|hsba?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+(?:%?\s*,\s*[\d\.]+)?)%?\s*\)|hsla?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+(?:%?\s*,\s*[\d\.]+)?)%?\s*\))\s*$/i,
        it = {
            NaN: 1,
            Infinity: 1,
            "-Infinity": 1
        }, st = /^(?:cubic-)?bezier\(([^,]+),([^,]+),([^,]+),([^\)]+)\)/,
        ot = U.round,
        ut = "setAttribute",
        at = parseFloat,
        ft = parseInt,
        lt = j.prototype.toUpperCase,
        ct = w._availableAttrs = {
            "arrow-end": "none",
            "arrow-start": "none",
            blur: 0,
            "clip-rect": "0 0 1e9 1e9",
            cursor: "default",
            cx: 0,
            cy: 0,
            fill: "#fff",
            "fill-opacity": 1,
            font: '10px "Arial"',
            "font-family": '"Arial"',
            "font-size": "10",
            "font-style": "normal",
            "font-weight": 400,
            gradient: 0,
            height: 0,
            href: "http://raphaeljs.com/",
            "letter-spacing": 0,
            opacity: 1,
            path: "M0,0",
            r: 0,
            rx: 0,
            ry: 0,
            src: "",
            stroke: "#000",
            "stroke-dasharray": "",
            "stroke-linecap": "butt",
            "stroke-linejoin": "butt",
            "stroke-miterlimit": 0,
            "stroke-opacity": 1,
            "stroke-width": 1,
            target: "_blank",
            "text-anchor": "middle",
            title: "Raphael",
            transform: "",
            width: 0,
            x: 0,
            y: 0
        }, ht = w._availableAnimAttrs = {
            blur: J,
            "clip-rect": "csv",
            cx: J,
            cy: J,
            fill: "colour",
            "fill-opacity": J,
            "font-size": J,
            height: J,
            opacity: J,
            path: "path",
            r: J,
            rx: J,
            ry: J,
            stroke: "colour",
            "stroke-opacity": J,
            "stroke-width": J,
            transform: "transform",
            width: J,
            x: J,
            y: J
        }, pt = /[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]/g,
        dt = /[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*,[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*/,
        vt = {
            hs: 1,
            rg: 1
        }, mt = /,?([achlmqrstvxz]),?/gi,
        gt = /([achlmrqstvz])[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029,]*((-?\d*\.?\d*(?:e[\-+]?\d+)?[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*,?[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*)+)/ig,
        yt = /([rstm])[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029,]*((-?\d*\.?\d*(?:e[\-+]?\d+)?[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*,?[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*)+)/ig,
        bt = /(-?\d*\.?\d*(?:e[\-+]?\d+)?)[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*,?[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*/ig,
        wt = w._radial_gradient = /^r(?:\(([^,]+?)[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*,[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*([^\)]+?)\))?/,
        Et = {}, St = function (e, t) {
            return e.key - t.key
        }, xt = function (e, t) {
            return at(e) - at(t)
        }, Tt = function () {}, Nt = function (e) {
            return e
        }, Ct = w._rectPath = function (e, t, n, r, i) {
            return i ? [
                ["M", e + i, t],
                ["l", n - i * 2, 0],
                ["a", i, i, 0, 0, 1, i, i],
                ["l", 0, r - i * 2],
                ["a", i, i, 0, 0, 1, -i, i],
                ["l", i * 2 - n, 0],
                ["a", i, i, 0, 0, 1, -i, -i],
                ["l", 0, i * 2 - r],
                ["a", i, i, 0, 0, 1, i, -i],
                ["z"]
            ] : [
                ["M", e, t],
                ["l", n, 0],
                ["l", 0, r],
                ["l", -n, 0],
                ["z"]
            ]
        }, kt = function (e, t, n, r) {
            return r == null && (r = n), [
                ["M", e, t],
                ["m", 0, -r],
                ["a", n, r, 0, 1, 1, 0, 2 * r],
                ["a", n, r, 0, 1, 1, 0, -2 * r],
                ["z"]
            ]
        }, Lt = w._getPath = {
            path: function (e) {
                return e.attr("path")
            },
            circle: function (e) {
                var t = e.attrs;
                return kt(t.cx, t.cy, t.r)
            },
            ellipse: function (e) {
                var t = e.attrs;
                return kt(t.cx, t.cy, t.rx, t.ry)
            },
            rect: function (e) {
                var t = e.attrs;
                return Ct(t.x, t.y, t.width, t.height, t.r)
            },
            image: function (e) {
                var t = e.attrs;
                return Ct(t.x, t.y, t.width, t.height)
            },
            text: function (e) {
                var t = e._getBBox();
                return Ct(t.x, t.y, t.width, t.height)
            }
        }, At = w.mapPath = function (e, t) {
            if (!t) return e;
            var n, r, i, s, o, u, a;
            e = Qt(e);
            for (i = 0, o = e.length; i < o; i++) {
                a = e[i];
                for (s = 1, u = a.length; s < u; s += 2) n = t.x(a[s], a[s + 1]), r = t.y(a[s], a[s + 1]), a[s] = n, a[s + 1] = r
            }
            return e
        };
    w._g = k, w.type = k.win.SVGAngle || k.doc.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1") ? "SVG" : "VML";
    if (w.type == "VML") {
        var Ot = k.doc.createElement("div"),
            Mt;
        Ot.innerHTML = '<v:shape adj="1"/>', Mt = Ot.firstChild, Mt.style.behavior = "url(#default#VML)";
        if (!Mt || typeof Mt.adj != "object") return w.type = H;
        Ot = null
    }
    w.svg = !(w.vml = w.type == "VML"), w._Paper = A, w.fn = O = A.prototype = w.prototype, w._id = 0, w._oid = 0, w.is = function (e, t) {
        return t = R.call(t), t == "finite" ? !it[C](+e) : t == "array" ? e instanceof Array : t == "null" && e === null || t == typeof e && e !== null || t == "object" && e === Object(e) || t == "array" && Array.isArray && Array.isArray(e) || Z.call(e).slice(8, -1).toLowerCase() == t
    }, w.angle = function (e, t, n, r, i, s) {
        if (i == null) {
            var o = e - n,
                u = t - r;
            return !o && !u ? 0 : (180 + U.atan2(-u, -o) * 180 / $ + 360) % 360
        }
        return w.angle(e, t, i, s) - w.angle(n, r, i, s)
    }, w.rad = function (e) {
        return e % 360 * $ / 180
    }, w.deg = function (e) {
        return e * 180 / $ % 360
    }, w.snapTo = function (e, t, n) {
        n = w.is(n, "finite") ? n : 10;
        if (w.is(e, Q)) {
            var r = e.length;
            while (r--)
                if (X(e[r] - t) <= n) return e[r]
        } else {
            e = +e;
            var i = t % e;
            if (i < n) return t - i;
            if (i > e - n) return t - i + e
        }
        return t
    };
    var _t = w.createUUID = function (e, t) {
        return function () {
            return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(e, t).toUpperCase()
        }
    }(/[xy]/g, function (e) {
        var t = U.random() * 16 | 0,
            n = e == "x" ? t : t & 3 | 8;
        return n.toString(16)
    });
    w.setWindow = function (e) {
        eve("raphael.setWindow", w, k.win, e), k.win = e, k.doc = k.win.document, w._engine.initWin && w._engine.initWin(k.win)
    };
    var Dt = function (e) {
        if (w.vml) {
            var t = /^\s+|\s+$/g,
                n;
            try {
                var r = new ActiveXObject("htmlfile");
                r.write("<body>"), r.close(), n = r.body
            } catch (i) {
                n = createPopup().document.body
            }
            var s = n.createTextRange();
            Dt = g(function (e) {
                try {
                    n.style.color = j(e).replace(t, H);
                    var r = s.queryCommandValue("ForeColor");
                    return r = (r & 255) << 16 | r & 65280 | (r & 16711680) >>> 16, "#" + ("000000" + r.toString(16)).slice(-6)
                } catch (i) {
                    return "none"
                }
            })
        } else {
            var o = k.doc.createElement("i");
            o.title = "Raphal Colour Picker", o.style.display = "none", k.doc.body.appendChild(o), Dt = g(function (e) {
                return o.style.color = e, k.doc.defaultView.getComputedStyle(o, H).getPropertyValue("color")
            })
        }
        return Dt(e)
    }, Pt = function () {
            return "hsb(" + [this.h, this.s, this.b] + ")"
        }, Ht = function () {
            return "hsl(" + [this.h, this.s, this.l] + ")"
        }, Bt = function () {
            return this.hex
        }, jt = function (e, t, n) {
            t == null && w.is(e, "object") && "r" in e && "g" in e && "b" in e && (n = e.b, t = e.g, e = e.r);
            if (t == null && w.is(e, K)) {
                var r = w.getRGB(e);
                e = r.r, t = r.g, n = r.b
            }
            if (e > 1 || t > 1 || n > 1) e /= 255, t /= 255, n /= 255;
            return [e, t, n]
        }, Ft = function (e, t, n, r) {
            e *= 255, t *= 255, n *= 255;
            var i = {
                r: e,
                g: t,
                b: n,
                hex: w.rgb(e, t, n),
                toString: Bt
            };
            return w.is(r, "finite") && (i.opacity = r), i
        };
    w.color = function (e) {
        var t;
        return w.is(e, "object") && "h" in e && "s" in e && "b" in e ? (t = w.hsb2rgb(e), e.r = t.r, e.g = t.g, e.b = t.b, e.hex = t.hex) : w.is(e, "object") && "h" in e && "s" in e && "l" in e ? (t = w.hsl2rgb(e), e.r = t.r, e.g = t.g, e.b = t.b, e.hex = t.hex) : (w.is(e, "string") && (e = w.getRGB(e)), w.is(e, "object") && "r" in e && "g" in e && "b" in e ? (t = w.rgb2hsl(e), e.h = t.h, e.s = t.s, e.l = t.l, t = w.rgb2hsb(e), e.v = t.b) : (e = {
            hex: "none"
        }, e.r = e.g = e.b = e.h = e.s = e.v = e.l = -1)), e.toString = Bt, e
    }, w.hsb2rgb = function (e, t, n, r) {
        this.is(e, "object") && "h" in e && "s" in e && "b" in e && (n = e.b, t = e.s, e = e.h, r = e.o), e *= 360;
        var i, s, o, u, a;
        return e = e % 360 / 60, a = n * t, u = a * (1 - X(e % 2 - 1)), i = s = o = n - a, e = ~~e, i += [a, u, 0, 0, u, a][e], s += [u, a, a, u, 0, 0][e], o += [0, 0, u, a, a, u][e], Ft(i, s, o, r)
    }, w.hsl2rgb = function (e, t, n, r) {
        this.is(e, "object") && "h" in e && "s" in e && "l" in e && (n = e.l, t = e.s, e = e.h);
        if (e > 1 || t > 1 || n > 1) e /= 360, t /= 100, n /= 100;
        e *= 360;
        var i, s, o, u, a;
        return e = e % 360 / 60, a = 2 * t * (n < .5 ? n : 1 - n), u = a * (1 - X(e % 2 - 1)), i = s = o = n - a / 2, e = ~~e, i += [a, u, 0, 0, u, a][e], s += [u, a, a, u, 0, 0][e], o += [0, 0, u, a, a, u][e], Ft(i, s, o, r)
    }, w.rgb2hsb = function (e, t, n) {
        n = jt(e, t, n), e = n[0], t = n[1], n = n[2];
        var r, i, s, o;
        return s = z(e, t, n), o = s - W(e, t, n), r = o == 0 ? null : s == e ? (t - n) / o : s == t ? (n - e) / o + 2 : (e - t) / o + 4, r = (r + 360) % 6 * 60 / 360, i = o == 0 ? 0 : o / s, {
            h: r,
            s: i,
            b: s,
            toString: Pt
        }
    }, w.rgb2hsl = function (e, t, n) {
        n = jt(e, t, n), e = n[0], t = n[1], n = n[2];
        var r, i, s, o, u, a;
        return o = z(e, t, n), u = W(e, t, n), a = o - u, r = a == 0 ? null : o == e ? (t - n) / a : o == t ? (n - e) / a + 2 : (e - t) / a + 4, r = (r + 360) % 6 * 60 / 360, s = (o + u) / 2, i = a == 0 ? 0 : s < .5 ? a / (2 * s) : a / (2 - 2 * s), {
            h: r,
            s: i,
            l: s,
            toString: Ht
        }
    }, w._path2string = function () {
        return this.join(",").replace(mt, "$1")
    };
    var It = w._preload = function (e, t) {
        var n = k.doc.createElement("img");
        n.style.cssText = "position:absolute;left:-9999em;top:-9999em", n.onload = function () {
            t.call(this), this.onload = null, k.doc.body.removeChild(this)
        }, n.onerror = function () {
            k.doc.body.removeChild(this)
        }, k.doc.body.appendChild(n), n.src = e
    };
    w.getRGB = g(function (e) {
        if (!e || !! ((e = j(e)).indexOf("-") + 1)) return {
            r: -1,
            g: -1,
            b: -1,
            hex: "none",
            error: 1,
            toString: m
        };
        if (e == "none") return {
            r: -1,
            g: -1,
            b: -1,
            hex: "none",
            toString: m
        };
        !vt[C](e.toLowerCase().substring(0, 2)) && e.charAt() != "#" && (e = Dt(e));
        var t, n, r, i, s, o, u, a = e.match(rt);
        return a ? (a[2] && (i = ft(a[2].substring(5), 16), r = ft(a[2].substring(3, 5), 16), n = ft(a[2].substring(1, 3), 16)), a[3] && (i = ft((o = a[3].charAt(3)) + o, 16), r = ft((o = a[3].charAt(2)) + o, 16), n = ft((o = a[3].charAt(1)) + o, 16)), a[4] && (u = a[4][F](dt), n = at(u[0]), u[0].slice(-1) == "%" && (n *= 2.55), r = at(u[1]), u[1].slice(-1) == "%" && (r *= 2.55), i = at(u[2]), u[2].slice(-1) == "%" && (i *= 2.55), a[1].toLowerCase().slice(0, 4) == "rgba" && (s = at(u[3])), u[3] && u[3].slice(-1) == "%" && (s /= 100)), a[5] ? (u = a[5][F](dt), n = at(u[0]), u[0].slice(-1) == "%" && (n *= 2.55), r = at(u[1]), u[1].slice(-1) == "%" && (r *= 2.55), i = at(u[2]), u[2].slice(-1) == "%" && (i *= 2.55), (u[0].slice(-3) == "deg" || u[0].slice(-1) == "") && (n /= 360), a[1].toLowerCase().slice(0, 4) == "hsba" && (s = at(u[3])), u[3] && u[3].slice(-1) == "%" && (s /= 100), w.hsb2rgb(n, r, i, s)) : a[6] ? (u = a[6][F](dt), n = at(u[0]), u[0].slice(-1) == "%" && (n *= 2.55), r = at(u[1]), u[1].slice(-1) == "%" && (r *= 2.55), i = at(u[2]), u[2].slice(-1) == "%" && (i *= 2.55), (u[0].slice(-3) == "deg" || u[0].slice(-1) == "") && (n /= 360), a[1].toLowerCase().slice(0, 4) == "hsla" && (s = at(u[3])), u[3] && u[3].slice(-1) == "%" && (s /= 100), w.hsl2rgb(n, r, i, s)) : (a = {
            r: n,
            g: r,
            b: i,
            toString: m
        }, a.hex = "#" + (16777216 | i | r << 8 | n << 16).toString(16).slice(1), w.is(s, "finite") && (a.opacity = s), a)) : {
            r: -1,
            g: -1,
            b: -1,
            hex: "none",
            error: 1,
            toString: m
        }
    }, w), w.hsb = g(function (e, t, n) {
        return w.hsb2rgb(e, t, n).hex
    }), w.hsl = g(function (e, t, n) {
        return w.hsl2rgb(e, t, n).hex
    }), w.rgb = g(function (e, t, n) {
        return "#" + (16777216 | n | t << 8 | e << 16).toString(16).slice(1)
    }), w.getColor = function (e) {
        var t = this.getColor.start = this.getColor.start || {
            h: 0,
            s: 1,
            b: e || .75
        }, n = this.hsb2rgb(t.h, t.s, t.b);
        return t.h += .075, t.h > 1 && (t.h = 0, t.s -= .2, t.s <= 0 && (this.getColor.start = {
            h: 0,
            s: 1,
            b: t.b
        })), n.hex
    }, w.getColor.reset = function () {
        delete this.start
    }, w.parsePathString = function (e) {
        if (!e) return null;
        var t = qt(e);
        if (t.arr) return Ut(t.arr);
        var n = {
            a: 7,
            c: 6,
            h: 1,
            l: 2,
            m: 2,
            r: 4,
            q: 4,
            s: 4,
            t: 2,
            v: 1,
            z: 0
        }, r = [];
        return w.is(e, Q) && w.is(e[0], Q) && (r = Ut(e)), r.length || j(e).replace(gt, function (e, t, i) {
            var s = [],
                o = t.toLowerCase();
            i.replace(bt, function (e, t) {
                t && s.push(+t)
            }), o == "m" && s.length > 2 && (r.push([t][D](s.splice(0, 2))), o = "l", t = t == "m" ? "l" : "L");
            if (o == "r") r.push([t][D](s));
            else
                while (s.length >= n[o]) {
                    r.push([t][D](s.splice(0, n[o])));
                    if (!n[o]) break
                }
        }), r.toString = w._path2string, t.arr = Ut(r), r
    }, w.parseTransformString = g(function (e) {
        if (!e) return null;
        var t = {
            r: 3,
            s: 4,
            t: 2,
            m: 6
        }, n = [];
        return w.is(e, Q) && w.is(e[0], Q) && (n = Ut(e)), n.length || j(e).replace(yt, function (e, t, r) {
            var i = [],
                s = R.call(t);
            r.replace(bt, function (e, t) {
                t && i.push(+t)
            }), n.push([t][D](i))
        }), n.toString = w._path2string, n
    });
    var qt = function (e) {
        var t = qt.ps = qt.ps || {};
        return t[e] ? t[e].sleep = 100 : t[e] = {
            sleep: 100
        }, setTimeout(function () {
            for (var n in t) t[C](n) && n != e && (t[n].sleep--, !t[n].sleep && delete t[n])
        }), t[e]
    };
    w.findDotsAtSegment = function (e, t, n, r, i, s, o, u, a) {
        var f = 1 - a,
            l = V(f, 3),
            c = V(f, 2),
            h = a * a,
            p = h * a,
            d = l * e + c * 3 * a * n + f * 3 * a * a * i + p * o,
            v = l * t + c * 3 * a * r + f * 3 * a * a * s + p * u,
            m = e + 2 * a * (n - e) + h * (i - 2 * n + e),
            g = t + 2 * a * (r - t) + h * (s - 2 * r + t),
            y = n + 2 * a * (i - n) + h * (o - 2 * i + n),
            b = r + 2 * a * (s - r) + h * (u - 2 * s + r),
            w = f * e + a * n,
            E = f * t + a * r,
            S = f * i + a * o,
            x = f * s + a * u,
            T = 90 - U.atan2(m - y, g - b) * 180 / $;
        return (m > y || g < b) && (T += 180), {
            x: d,
            y: v,
            m: {
                x: m,
                y: g
            },
            n: {
                x: y,
                y: b
            },
            start: {
                x: w,
                y: E
            },
            end: {
                x: S,
                y: x
            },
            alpha: T
        }
    }, w.bezierBBox = function (e, t, n, r, i, s, o, u) {
        w.is(e, "array") || (e = [e, t, n, r, i, s, o, u]);
        var a = Kt.apply(null, e);
        return {
            x: a.min.x,
            y: a.min.y,
            x2: a.max.x,
            y2: a.max.y,
            width: a.max.x - a.min.x,
            height: a.max.y - a.min.y
        }
    }, w.isPointInsideBBox = function (e, t, n) {
        return t >= e.x && t <= e.x2 && n >= e.y && n <= e.y2
    }, w.isBBoxIntersect = function (e, t) {
        var n = w.isPointInsideBBox;
        return n(t, e.x, e.y) || n(t, e.x2, e.y) || n(t, e.x, e.y2) || n(t, e.x2, e.y2) || n(e, t.x, t.y) || n(e, t.x2, t.y) || n(e, t.x, t.y2) || n(e, t.x2, t.y2) || (e.x < t.x2 && e.x > t.x || t.x < e.x2 && t.x > e.x) && (e.y < t.y2 && e.y > t.y || t.y < e.y2 && t.y > e.y)
    }, w.pathIntersection = function (e, t) {
        return u(e, t)
    }, w.pathIntersectionNumber = function (e, t) {
        return u(e, t, 1)
    }, w.isPointInsidePath = function (e, t, n) {
        var r = w.pathBBox(e);
        return w.isPointInsideBBox(r, t, n) && u(e, [
            ["M", t, n],
            ["H", r.x2 + 10]
        ], 1) % 2 == 1
    }, w._removedFactory = function (e) {
        return function () {
            eve("raphael.log", null, "Raphal: you are calling to method " + e + " of removed object", e)
        }
    };
    var Rt = w.pathBBox = function (e) {
        var t = qt(e);
        if (t.bbox) return t.bbox;
        if (!e) return {
            x: 0,
            y: 0,
            width: 0,
            height: 0,
            x2: 0,
            y2: 0
        };
        e = Qt(e);
        var n = 0,
            r = 0,
            i = [],
            s = [],
            o;
        for (var u = 0, a = e.length; u < a; u++) {
            o = e[u];
            if (o[0] == "M") n = o[1], r = o[2], i.push(n), s.push(r);
            else {
                var f = Kt(n, r, o[1], o[2], o[3], o[4], o[5], o[6]);
                i = i[D](f.min.x, f.max.x), s = s[D](f.min.y, f.max.y), n = o[5], r = o[6]
            }
        }
        var l = W[_](0, i),
            c = W[_](0, s),
            h = z[_](0, i),
            p = z[_](0, s),
            d = {
                x: l,
                y: c,
                x2: h,
                y2: p,
                width: h - l,
                height: p - c
            };
        return t.bbox = b(d), d
    }, Ut = function (e) {
            var t = b(e);
            return t.toString = w._path2string, t
        }, zt = w._pathToRelative = function (e) {
            var t = qt(e);
            if (t.rel) return Ut(t.rel);
            if (!w.is(e, Q) || !w.is(e && e[0], Q)) e = w.parsePathString(e);
            var n = [],
                r = 0,
                i = 0,
                s = 0,
                o = 0,
                u = 0;
            e[0][0] == "M" && (r = e[0][1], i = e[0][2], s = r, o = i, u++, n.push(["M", r, i]));
            for (var a = u, f = e.length; a < f; a++) {
                var l = n[a] = [],
                    c = e[a];
                if (c[0] != R.call(c[0])) {
                    l[0] = R.call(c[0]);
                    switch (l[0]) {
                    case "a":
                        l[1] = c[1], l[2] = c[2], l[3] = c[3], l[4] = c[4], l[5] = c[5], l[6] = +(c[6] - r).toFixed(3), l[7] = +(c[7] - i).toFixed(3);
                        break;
                    case "v":
                        l[1] = +(c[1] - i).toFixed(3);
                        break;
                    case "m":
                        s = c[1], o = c[2];
                    default:
                        for (var h = 1, p = c.length; h < p; h++) l[h] = +(c[h] - (h % 2 ? r : i)).toFixed(3)
                    }
                } else {
                    l = n[a] = [], c[0] == "m" && (s = c[1] + r, o = c[2] + i);
                    for (var d = 0, v = c.length; d < v; d++) n[a][d] = c[d]
                }
                var m = n[a].length;
                switch (n[a][0]) {
                case "z":
                    r = s, i = o;
                    break;
                case "h":
                    r += +n[a][m - 1];
                    break;
                case "v":
                    i += +n[a][m - 1];
                    break;
                default:
                    r += +n[a][m - 2], i += +n[a][m - 1]
                }
            }
            return n.toString = w._path2string, t.rel = Ut(n), n
        }, Wt = w._pathToAbsolute = function (e) {
            var t = qt(e);
            if (t.abs) return Ut(t.abs);
            if (!w.is(e, Q) || !w.is(e && e[0], Q)) e = w.parsePathString(e);
            if (!e || !e.length) return [["M", 0, 0]];
            var n = [],
                r = 0,
                i = 0,
                s = 0,
                o = 0,
                u = 0;
            e[0][0] == "M" && (r = +e[0][1], i = +e[0][2], s = r, o = i, u++, n[0] = ["M", r, i]);
            var a = e.length == 3 && e[0][0] == "M" && e[1][0].toUpperCase() == "R" && e[2][0].toUpperCase() == "Z";
            for (var f, l, c = u, h = e.length; c < h; c++) {
                n.push(f = []), l = e[c];
                if (l[0] != lt.call(l[0])) {
                    f[0] = lt.call(l[0]);
                    switch (f[0]) {
                    case "A":
                        f[1] = l[1], f[2] = l[2], f[3] = l[3], f[4] = l[4], f[5] = l[5], f[6] = +(l[6] + r), f[7] = +(l[7] + i);
                        break;
                    case "V":
                        f[1] = +l[1] + i;
                        break;
                    case "H":
                        f[1] = +l[1] + r;
                        break;
                    case "R":
                        var p = [r, i][D](l.slice(1));
                        for (var d = 2, m = p.length; d < m; d++) p[d] = +p[d] + r, p[++d] = +p[d] + i;
                        n.pop(), n = n[D](v(p, a));
                        break;
                    case "M":
                        s = +l[1] + r, o = +l[2] + i;
                    default:
                        for (d = 1, m = l.length; d < m; d++) f[d] = +l[d] + (d % 2 ? r : i)
                    }
                } else if (l[0] == "R") p = [r, i][D](l.slice(1)), n.pop(), n = n[D](v(p, a)), f = ["R"][D](l.slice(-2));
                else
                    for (var g = 0, y = l.length; g < y; g++) f[g] = l[g];
                switch (f[0]) {
                case "Z":
                    r = s, i = o;
                    break;
                case "H":
                    r = f[1];
                    break;
                case "V":
                    i = f[1];
                    break;
                case "M":
                    s = f[f.length - 2], o = f[f.length - 1];
                default:
                    r = f[f.length - 2], i = f[f.length - 1]
                }
            }
            return n.toString = w._path2string, t.abs = Ut(n), n
        }, Xt = function (e, t, n, r) {
            return [e, t, n, r, n, r]
        }, Vt = function (e, t, n, r, i, s) {
            var o = 1 / 3,
                u = 2 / 3;
            return [o * e + u * n, o * t + u * r, o * i + u * n, o * s + u * r, i, s]
        }, $t = function (e, t, n, r, i, s, o, u, a, f) {
            var l = $ * 120 / 180,
                c = $ / 180 * (+i || 0),
                h = [],
                p, d = g(function (e, t, n) {
                    var r = e * U.cos(n) - t * U.sin(n),
                        i = e * U.sin(n) + t * U.cos(n);
                    return {
                        x: r,
                        y: i
                    }
                });
            if (!f) {
                p = d(e, t, -c), e = p.x, t = p.y, p = d(u, a, -c), u = p.x, a = p.y;
                var v = U.cos($ / 180 * i),
                    m = U.sin($ / 180 * i),
                    y = (e - u) / 2,
                    b = (t - a) / 2,
                    w = y * y / (n * n) + b * b / (r * r);
                w > 1 && (w = U.sqrt(w), n = w * n, r = w * r);
                var E = n * n,
                    S = r * r,
                    x = (s == o ? -1 : 1) * U.sqrt(X((E * S - E * b * b - S * y * y) / (E * b * b + S * y * y))),
                    T = x * n * b / r + (e + u) / 2,
                    N = x * -r * y / n + (t + a) / 2,
                    C = U.asin(((t - N) / r).toFixed(9)),
                    k = U.asin(((a - N) / r).toFixed(9));
                C = e < T ? $ - C : C, k = u < T ? $ - k : k, C < 0 && (C = $ * 2 + C), k < 0 && (k = $ * 2 + k), o && C > k && (C -= $ * 2), !o && k > C && (k -= $ * 2)
            } else C = f[0], k = f[1], T = f[2], N = f[3];
            var L = k - C;
            if (X(L) > l) {
                var A = k,
                    O = u,
                    M = a;
                k = C + l * (o && k > C ? 1 : -1), u = T + n * U.cos(k), a = N + r * U.sin(k), h = $t(u, a, n, r, i, 0, o, O, M, [k, A, T, N])
            }
            L = k - C;
            var _ = U.cos(C),
                P = U.sin(C),
                H = U.cos(k),
                B = U.sin(k),
                j = U.tan(L / 4),
                I = 4 / 3 * n * j,
                q = 4 / 3 * r * j,
                R = [e, t],
                z = [e + I * P, t - q * _],
                W = [u + I * B, a - q * H],
                V = [u, a];
            z[0] = 2 * R[0] - z[0], z[1] = 2 * R[1] - z[1];
            if (f) return [z, W, V][D](h);
            h = [z, W, V][D](h).join()[F](",");
            var J = [];
            for (var K = 0, Q = h.length; K < Q; K++) J[K] = K % 2 ? d(h[K - 1], h[K], c).y : d(h[K], h[K + 1], c).x;
            return J
        }, Jt = function (e, t, n, r, i, s, o, u, a) {
            var f = 1 - a;
            return {
                x: V(f, 3) * e + V(f, 2) * 3 * a * n + f * 3 * a * a * i + V(a, 3) * o,
                y: V(f, 3) * t + V(f, 2) * 3 * a * r + f * 3 * a * a * s + V(a, 3) * u
            }
        }, Kt = g(function (e, t, n, r, i, s, o, u) {
            var a = i - 2 * n + e - (o - 2 * i + n),
                f = 2 * (n - e) - 2 * (i - n),
                l = e - n,
                c = (-f + U.sqrt(f * f - 4 * a * l)) / 2 / a,
                h = (-f - U.sqrt(f * f - 4 * a * l)) / 2 / a,
                p = [t, u],
                d = [e, o],
                v;
            return X(c) > "1e12" && (c = .5), X(h) > "1e12" && (h = .5), c > 0 && c < 1 && (v = Jt(e, t, n, r, i, s, o, u, c), d.push(v.x), p.push(v.y)), h > 0 && h < 1 && (v = Jt(e, t, n, r, i, s, o, u, h), d.push(v.x), p.push(v.y)), a = s - 2 * r + t - (u - 2 * s + r), f = 2 * (r - t) - 2 * (s - r), l = t - r, c = (-f + U.sqrt(f * f - 4 * a * l)) / 2 / a, h = (-f - U.sqrt(f * f - 4 * a * l)) / 2 / a, X(c) > "1e12" && (c = .5), X(h) > "1e12" && (h = .5), c > 0 && c < 1 && (v = Jt(e, t, n, r, i, s, o, u, c), d.push(v.x), p.push(v.y)), h > 0 && h < 1 && (v = Jt(e, t, n, r, i, s, o, u, h), d.push(v.x), p.push(v.y)), {
                min: {
                    x: W[_](0, d),
                    y: W[_](0, p)
                },
                max: {
                    x: z[_](0, d),
                    y: z[_](0, p)
                }
            }
        }),
        Qt = w._path2curve = g(function (e, t) {
            var n = !t && qt(e);
            if (!t && n.curve) return Ut(n.curve);
            var r = Wt(e),
                i = t && Wt(t),
                s = {
                    x: 0,
                    y: 0,
                    bx: 0,
                    by: 0,
                    X: 0,
                    Y: 0,
                    qx: null,
                    qy: null
                }, o = {
                    x: 0,
                    y: 0,
                    bx: 0,
                    by: 0,
                    X: 0,
                    Y: 0,
                    qx: null,
                    qy: null
                }, u = function (e, t) {
                    var n, r;
                    if (!e) return ["C", t.x, t.y, t.x, t.y, t.x, t.y];
                    !(e[0] in {
                        T: 1,
                        Q: 1
                    }) && (t.qx = t.qy = null);
                    switch (e[0]) {
                    case "M":
                        t.X = e[1], t.Y = e[2];
                        break;
                    case "A":
                        e = ["C"][D]($t[_](0, [t.x, t.y][D](e.slice(1))));
                        break;
                    case "S":
                        n = t.x + (t.x - (t.bx || t.x)), r = t.y + (t.y - (t.by || t.y)), e = ["C", n, r][D](e.slice(1));
                        break;
                    case "T":
                        t.qx = t.x + (t.x - (t.qx || t.x)), t.qy = t.y + (t.y - (t.qy || t.y)), e = ["C"][D](Vt(t.x, t.y, t.qx, t.qy, e[1], e[2]));
                        break;
                    case "Q":
                        t.qx = e[1], t.qy = e[2], e = ["C"][D](Vt(t.x, t.y, e[1], e[2], e[3], e[4]));
                        break;
                    case "L":
                        e = ["C"][D](Xt(t.x, t.y, e[1], e[2]));
                        break;
                    case "H":
                        e = ["C"][D](Xt(t.x, t.y, e[1], t.y));
                        break;
                    case "V":
                        e = ["C"][D](Xt(t.x, t.y, t.x, e[1]));
                        break;
                    case "Z":
                        e = ["C"][D](Xt(t.x, t.y, t.X, t.Y))
                    }
                    return e
                }, a = function (e, t) {
                    if (e[t].length > 7) {
                        e[t].shift();
                        var n = e[t];
                        while (n.length) e.splice(t++, 0, ["C"][D](n.splice(0, 6)));
                        e.splice(t, 1), c = z(r.length, i && i.length || 0)
                    }
                }, f = function (e, t, n, s, o) {
                    e && t && e[o][0] == "M" && t[o][0] != "M" && (t.splice(o, 0, ["M", s.x, s.y]), n.bx = 0, n.by = 0, n.x = e[o][1], n.y = e[o][2], c = z(r.length, i && i.length || 0))
                };
            for (var l = 0, c = z(r.length, i && i.length || 0); l < c; l++) {
                r[l] = u(r[l], s), a(r, l), i && (i[l] = u(i[l], o)), i && a(i, l), f(r, i, s, o, l), f(i, r, o, s, l);
                var h = r[l],
                    p = i && i[l],
                    d = h.length,
                    v = i && p.length;
                s.x = h[d - 2], s.y = h[d - 1], s.bx = at(h[d - 4]) || s.x, s.by = at(h[d - 3]) || s.y, o.bx = i && (at(p[v - 4]) || o.x), o.by = i && (at(p[v - 3]) || o.y), o.x = i && p[v - 2], o.y = i && p[v - 1]
            }
            return i || (n.curve = Ut(r)), i ? [r, i] : r
        }, null, Ut),
        Gt = w._parseDots = g(function (e) {
            var t = [];
            for (var n = 0, r = e.length; n < r; n++) {
                var i = {}, s = e[n].match(/^([^:]*):?([\d\.]*)/);
                i.color = w.getRGB(s[1]);
                if (i.color.error) return null;
                i.color = i.color.hex, s[2] && (i.offset = s[2] + "%"), t.push(i)
            }
            for (n = 1, r = t.length - 1; n < r; n++)
                if (!t[n].offset) {
                    var o = at(t[n - 1].offset || 0),
                        u = 0;
                    for (var a = n + 1; a < r; a++)
                        if (t[a].offset) {
                            u = t[a].offset;
                            break
                        }
                    u || (u = 100, a = r), u = at(u);
                    var f = (u - o) / (a - n + 1);
                    for (; n < a; n++) o += f, t[n].offset = o + "%"
                }
            return t
        }),
        Yt = w._tear = function (e, t) {
            e == t.top && (t.top = e.prev), e == t.bottom && (t.bottom = e.next), e.next && (e.next.prev = e.prev), e.prev && (e.prev.next = e.next)
        }, Zt = w._tofront = function (e, t) {
            t.top !== e && (Yt(e, t), e.next = null, e.prev = t.top, t.top.next = e, t.top = e)
        }, en = w._toback = function (e, t) {
            t.bottom !== e && (Yt(e, t), e.next = t.bottom, e.prev = null, t.bottom.prev = e, t.bottom = e)
        }, tn = w._insertafter = function (e, t, n) {
            Yt(e, n), t == n.top && (n.top = e), t.next && (t.next.prev = e), e.next = t.next, e.prev = t, t.next = e
        }, nn = w._insertbefore = function (e, t, n) {
            Yt(e, n), t == n.bottom && (n.bottom = e), t.prev && (t.prev.next = e), e.prev = t.prev, t.prev = e, e.next = t
        }, rn = w.toMatrix = function (e, t) {
            var n = Rt(e),
                r = {
                    _: {
                        transform: H
                    },
                    getBBox: function () {
                        return n
                    }
                };
            return on(r, t), r.matrix
        }, sn = w.transformPath = function (e, t) {
            return At(e, rn(e, t))
        }, on = w._extractTransform = function (e, t) {
            if (t == null) return e._.transform;
            t = j(t).replace(/\.{3}|\u2026/g, e._.transform || H);
            var n = w.parseTransformString(t),
                r = 0,
                i = 0,
                s = 0,
                u = 1,
                a = 1,
                f = e._,
                l = new o;
            f.transform = n || [];
            if (n)
                for (var c = 0, h = n.length; c < h; c++) {
                    var p = n[c],
                        d = p.length,
                        v = j(p[0]).toLowerCase(),
                        m = p[0] != v,
                        g = m ? l.invert() : 0,
                        y, b, E, S, x;
                    v == "t" && d == 3 ? m ? (y = g.x(0, 0), b = g.y(0, 0), E = g.x(p[1], p[2]), S = g.y(p[1], p[2]), l.translate(E - y, S - b)) : l.translate(p[1], p[2]) : v == "r" ? d == 2 ? (x = x || e.getBBox(1), l.rotate(p[1], x.x + x.width / 2, x.y + x.height / 2), r += p[1]) : d == 4 && (m ? (E = g.x(p[2], p[3]), S = g.y(p[2], p[3]), l.rotate(p[1], E, S)) : l.rotate(p[1], p[2], p[3]), r += p[1]) : v == "s" ? d == 2 || d == 3 ? (x = x || e.getBBox(1), l.scale(p[1], p[d - 1], x.x + x.width / 2, x.y + x.height / 2), u *= p[1], a *= p[d - 1]) : d == 5 && (m ? (E = g.x(p[3], p[4]), S = g.y(p[3], p[4]), l.scale(p[1], p[2], E, S)) : l.scale(p[1], p[2], p[3], p[4]), u *= p[1], a *= p[2]) : v == "m" && d == 7 && l.add(p[1], p[2], p[3], p[4], p[5], p[6]), f.dirtyT = 1, e.matrix = l
                }
            e.matrix = l, f.sx = u, f.sy = a, f.deg = r, f.dx = i = l.e, f.dy = s = l.f, u == 1 && a == 1 && !r && f.bbox ? (f.bbox.x += +i, f.bbox.y += +s) : f.dirtyT = 1
        }, un = function (e) {
            var t = e[0];
            switch (t.toLowerCase()) {
            case "t":
                return [t, 0, 0];
            case "m":
                return [t, 1, 0, 0, 1, 0, 0];
            case "r":
                return e.length == 4 ? [t, 0, e[2], e[3]] : [t, 0];
            case "s":
                return e.length == 5 ? [t, 1, 1, e[3], e[4]] : e.length == 3 ? [t, 1, 1] : [t, 1]
            }
        }, an = w._equaliseTransform = function (e, t) {
            t = j(t).replace(/\.{3}|\u2026/g, e), e = w.parseTransformString(e) || [], t = w.parseTransformString(t) || [];
            var n = z(e.length, t.length),
                r = [],
                i = [],
                s = 0,
                o, u, a, f;
            for (; s < n; s++) {
                a = e[s] || un(t[s]), f = t[s] || un(a);
                if (a[0] != f[0] || a[0].toLowerCase() == "r" && (a[2] != f[2] || a[3] != f[3]) || a[0].toLowerCase() == "s" && (a[3] != f[3] || a[4] != f[4])) return;
                r[s] = [], i[s] = [];
                for (o = 0, u = z(a.length, f.length); o < u; o++) o in a && (r[s][o] = a[o]), o in f && (i[s][o] = f[o])
            }
            return {
                from: r,
                to: i
            }
        };
    w._getContainer = function (e, t, n, r) {
        var i;
        i = r == null && !w.is(e, "object") ? k.doc.getElementById(e) : e;
        if (i != null) return i.tagName ? t == null ? {
            container: i,
            width: i.style.pixelWidth || i.offsetWidth,
            height: i.style.pixelHeight || i.offsetHeight
        } : {
            container: i,
            width: t,
            height: n
        } : {
            container: 1,
            x: e,
            y: t,
            width: n,
            height: r
        }
    }, w.pathToRelative = zt, w._engine = {}, w.path2curve = Qt, w.matrix = function (e, t, n, r, i, s) {
        return new o(e, t, n, r, i, s)
    },
    function (e) {
        function t(e) {
            var t = U.sqrt(n(e));
            e[0] && (e[0] /= t), e[1] && (e[1] /= t)
        }

        function n(e) {
            return e[0] * e[0] + e[1] * e[1]
        }
        e.add = function (e, t, n, r, i, s) {
            var u = [
                [],
                [],
                []
            ],
                a = [
                    [this.a, this.c, this.e],
                    [this.b, this.d, this.f],
                    [0, 0, 1]
                ],
                f = [
                    [e, n, i],
                    [t, r, s],
                    [0, 0, 1]
                ],
                l, c, h, p;
            e && e instanceof o && (f = [
                [e.a, e.c, e.e],
                [e.b, e.d, e.f],
                [0, 0, 1]
            ]);
            for (l = 0; l < 3; l++)
                for (c = 0; c < 3; c++) {
                    p = 0;
                    for (h = 0; h < 3; h++) p += a[l][h] * f[h][c];
                    u[l][c] = p
                }
            this.a = u[0][0], this.b = u[1][0], this.c = u[0][1], this.d = u[1][1], this.e = u[0][2], this.f = u[1][2]
        }, e.invert = function () {
            var e = this,
                t = e.a * e.d - e.b * e.c;
            return new o(e.d / t, -e.b / t, -e.c / t, e.a / t, (e.c * e.f - e.d * e.e) / t, (e.b * e.e - e.a * e.f) / t)
        }, e.clone = function () {
            return new o(this.a, this.b, this.c, this.d, this.e, this.f)
        }, e.translate = function (e, t) {
            this.add(1, 0, 0, 1, e, t)
        }, e.scale = function (e, t, n, r) {
            t == null && (t = e), (n || r) && this.add(1, 0, 0, 1, n, r), this.add(e, 0, 0, t, 0, 0), (n || r) && this.add(1, 0, 0, 1, -n, -r)
        }, e.rotate = function (e, t, n) {
            e = w.rad(e), t = t || 0, n = n || 0;
            var r = +U.cos(e).toFixed(9),
                i = +U.sin(e).toFixed(9);
            this.add(r, i, -i, r, t, n), this.add(1, 0, 0, 1, -t, -n)
        }, e.x = function (e, t) {
            return e * this.a + t * this.c + this.e
        }, e.y = function (e, t) {
            return e * this.b + t * this.d + this.f
        }, e.get = function (e) {
            return +this[j.fromCharCode(97 + e)].toFixed(4)
        }, e.toString = function () {
            return w.svg ? "matrix(" + [this.get(0), this.get(1), this.get(2), this.get(3), this.get(4), this.get(5)].join() + ")" : [this.get(0), this.get(2), this.get(1), this.get(3), 0, 0].join()
        }, e.toFilter = function () {
            return "progid:DXImageTransform.Microsoft.Matrix(M11=" + this.get(0) + ", M12=" + this.get(2) + ", M21=" + this.get(1) + ", M22=" + this.get(3) + ", Dx=" + this.get(4) + ", Dy=" + this.get(5) + ", sizingmethod='auto expand')"
        }, e.offset = function () {
            return [this.e.toFixed(4), this.f.toFixed(4)]
        }, e.split = function () {
            var e = {};
            e.dx = this.e, e.dy = this.f;
            var r = [
                [this.a, this.c],
                [this.b, this.d]
            ];
            e.scalex = U.sqrt(n(r[0])), t(r[0]), e.shear = r[0][0] * r[1][0] + r[0][1] * r[1][1], r[1] = [r[1][0] - r[0][0] * e.shear, r[1][1] - r[0][1] * e.shear], e.scaley = U.sqrt(n(r[1])), t(r[1]), e.shear /= e.scaley;
            var i = -r[0][1],
                s = r[1][1];
            return s < 0 ? (e.rotate = w.deg(U.acos(s)), i < 0 && (e.rotate = 360 - e.rotate)) : e.rotate = w.deg(U.asin(i)), e.isSimple = !+e.shear.toFixed(9) && (e.scalex.toFixed(9) == e.scaley.toFixed(9) || !e.rotate), e.isSuperSimple = !+e.shear.toFixed(9) && e.scalex.toFixed(9) == e.scaley.toFixed(9) && !e.rotate, e.noRotation = !+e.shear.toFixed(9) && !e.rotate, e
        }, e.toTransformString = function (e) {
            var t = e || this[F]();
            return t.isSimple ? (t.scalex = +t.scalex.toFixed(4), t.scaley = +t.scaley.toFixed(4), t.rotate = +t.rotate.toFixed(4), (t.dx || t.dy ? "t" + [t.dx, t.dy] : H) + (t.scalex != 1 || t.scaley != 1 ? "s" + [t.scalex, t.scaley, 0, 0] : H) + (t.rotate ? "r" + [t.rotate, 0, 0] : H)) : "m" + [this.get(0), this.get(1), this.get(2), this.get(3), this.get(4), this.get(5)]
        }
    }(o.prototype);
    var fn = navigator.userAgent.match(/Version\/(.*?)\s/) || navigator.userAgent.match(/Chrome\/(\d+)/);
    navigator.vendor == "Apple Computer, Inc." && (fn && fn[1] < 4 || navigator.platform.slice(0, 2) == "iP") || navigator.vendor == "Google Inc." && fn && fn[1] < 8 ? O.safari = function () {
        var e = this.rect(-99, -99, this.width + 99, this.height + 99).attr({
            stroke: "none"
        });
        setTimeout(function () {
            e.remove()
        })
    } : O.safari = Tt;
    var ln = function () {
        this.returnValue = !1
    }, cn = function () {
            return this.originalEvent.preventDefault()
        }, hn = function () {
            this.cancelBubble = !0
        }, pn = function () {
            return this.originalEvent.stopPropagation()
        }, dn = function () {
            if (k.doc.addEventListener) return function (e, t, n, r) {
                var i = P && q[t] ? q[t] : t,
                    s = function (i) {
                        var s = k.doc.documentElement.scrollTop || k.doc.body.scrollTop,
                            o = k.doc.documentElement.scrollLeft || k.doc.body.scrollLeft,
                            u = i.clientX + o,
                            a = i.clientY + s;
                        if (P && q[C](t))
                            for (var f = 0, l = i.targetTouches && i.targetTouches.length; f < l; f++)
                                if (i.targetTouches[f].target == e) {
                                    var c = i;
                                    i = i.targetTouches[f], i.originalEvent = c, i.preventDefault = cn, i.stopPropagation = pn;
                                    break
                                }
                        return n.call(r, i, u, a)
                    };
                return e.addEventListener(i, s, !1),
                function () {
                    return e.removeEventListener(i, s, !1), !0
                }
            };
            if (k.doc.attachEvent) return function (e, t, n, r) {
                var i = function (e) {
                    e = e || k.win.event;
                    var t = k.doc.documentElement.scrollTop || k.doc.body.scrollTop,
                        i = k.doc.documentElement.scrollLeft || k.doc.body.scrollLeft,
                        s = e.clientX + i,
                        o = e.clientY + t;
                    return e.preventDefault = e.preventDefault || ln, e.stopPropagation = e.stopPropagation || hn, n.call(r, e, s, o)
                };
                e.attachEvent("on" + t, i);
                var s = function () {
                    return e.detachEvent("on" + t, i), !0
                };
                return s
            }
        }(),
        vn = [],
        mn = function (e) {
            var t = e.clientX,
                n = e.clientY,
                r = k.doc.documentElement.scrollTop || k.doc.body.scrollTop,
                i = k.doc.documentElement.scrollLeft || k.doc.body.scrollLeft,
                s, o = vn.length;
            while (o--) {
                s = vn[o];
                if (P) {
                    var u = e.touches.length,
                        a;
                    while (u--) {
                        a = e.touches[u];
                        if (a.identifier == s.el._drag.id) {
                            t = a.clientX, n = a.clientY, (e.originalEvent ? e.originalEvent : e).preventDefault();
                            break
                        }
                    }
                } else e.preventDefault();
                var f = s.el.node,
                    l, c = f.nextSibling,
                    h = f.parentNode,
                    p = f.style.display;
                k.win.opera && h.removeChild(f), f.style.display = "none", l = s.el.paper.getElementByPoint(t, n), f.style.display = p, k.win.opera && (c ? h.insertBefore(f, c) : h.appendChild(f)), l && eve("raphael.drag.over." + s.el.id, s.el, l), t += i, n += r, eve("raphael.drag.move." + s.el.id, s.move_scope || s.el, t - s.el._drag.x, n - s.el._drag.y, t, n, e)
            }
        }, gn = function (e) {
            w.unmousemove(mn).unmouseup(gn);
            var t = vn.length,
                n;
            while (t--) n = vn[t], n.el._drag = {}, eve("raphael.drag.end." + n.el.id, n.end_scope || n.start_scope || n.move_scope || n.el, e);
            vn = []
        }, yn = w.el = {};
    for (var bn = I.length; bn--;)(function (e) {
        w[e] = yn[e] = function (t, n) {
            return w.is(t, "function") && (this.events = this.events || [], this.events.push({
                name: e,
                f: t,
                unbind: dn(this.shape || this.node || k.doc, e, t, n || this)
            })), this
        }, w["un" + e] = yn["un" + e] = function (t) {
            var n = this.events || [],
                r = n.length;
            while (r--)
                if (n[r].name == e && n[r].f == t) return n[r].unbind(), n.splice(r, 1), !n.length && delete this.events, this;
            return this
        }
    })(I[bn]);
    yn.data = function (e, t) {
        var n = Et[this.id] = Et[this.id] || {};
        if (arguments.length == 1) {
            if (w.is(e, "object")) {
                for (var r in e) e[C](r) && this.data(r, e[r]);
                return this
            }
            return eve("raphael.data.get." + this.id, this, n[e], e), n[e]
        }
        return n[e] = t, eve("raphael.data.set." + this.id, this, t, e), this
    }, yn.removeData = function (e) {
        return e == null ? Et[this.id] = {} : Et[this.id] && delete Et[this.id][e], this
    }, yn.hover = function (e, t, n, r) {
        return this.mouseover(e, n).mouseout(t, r || n)
    }, yn.unhover = function (e, t) {
        return this.unmouseover(e).unmouseout(t)
    };
    var wn = [];
    yn.drag = function (e, t, n, r, i, s) {
        function o(o) {
            (o.originalEvent || o).preventDefault();
            var u = k.doc.documentElement.scrollTop || k.doc.body.scrollTop,
                a = k.doc.documentElement.scrollLeft || k.doc.body.scrollLeft;
            this._drag.x = o.clientX + a, this._drag.y = o.clientY + u, this._drag.id = o.identifier, !vn.length && w.mousemove(mn).mouseup(gn), vn.push({
                el: this,
                move_scope: r,
                start_scope: i,
                end_scope: s
            }), t && eve.on("raphael.drag.start." + this.id, t), e && eve.on("raphael.drag.move." + this.id, e), n && eve.on("raphael.drag.end." + this.id, n), eve("raphael.drag.start." + this.id, i || r || this, o.clientX + a, o.clientY + u, o)
        }
        return this._drag = {}, wn.push({
            el: this,
            start: o
        }), this.mousedown(o), this
    }, yn.onDragOver = function (e) {
        e ? eve.on("raphael.drag.over." + this.id, e) : eve.unbind("raphael.drag.over." + this.id)
    }, yn.undrag = function () {
        var e = wn.length;
        while (e--) wn[e].el == this && (this.unmousedown(wn[e].start), wn.splice(e, 1), eve.unbind("raphael.drag.*." + this.id));
        !wn.length && w.unmousemove(mn).unmouseup(gn)
    }, O.circle = function (e, t, n) {
        var r = w._engine.circle(this, e || 0, t || 0, n || 0);
        return this.__set__ && this.__set__.push(r), r
    }, O.rect = function (e, t, n, r, i) {
        var s = w._engine.rect(this, e || 0, t || 0, n || 0, r || 0, i || 0);
        return this.__set__ && this.__set__.push(s), s
    }, O.ellipse = function (e, t, n, r) {
        var i = w._engine.ellipse(this, e || 0, t || 0, n || 0, r || 0);
        return this.__set__ && this.__set__.push(i), i
    }, O.path = function (e) {
        e && !w.is(e, K) && !w.is(e[0], Q) && (e += H);
        var t = w._engine.path(w.format[_](w, arguments), this);
        return this.__set__ && this.__set__.push(t), t
    }, O.image = function (e, t, n, r, i) {
        var s = w._engine.image(this, e || "about:blank", t || 0, n || 0, r || 0, i || 0);
        return this.__set__ && this.__set__.push(s), s
    }, O.text = function (e, t, n) {
        var r = w._engine.text(this, e || 0, t || 0, j(n));
        return this.__set__ && this.__set__.push(r), r
    }, O.set = function (e) {
        !w.is(e, "array") && (e = Array.prototype.splice.call(arguments, 0, arguments.length));
        var t = new Dn(e);
        return this.__set__ && this.__set__.push(t), t
    }, O.setStart = function (e) {
        this.__set__ = e || this.set()
    }, O.setFinish = function (e) {
        var t = this.__set__;
        return delete this.__set__, t
    }, O.setSize = function (e, t) {
        return w._engine.setSize.call(this, e, t)
    }, O.setViewBox = function (e, t, n, r, i) {
        return w._engine.setViewBox.call(this, e, t, n, r, i)
    }, O.top = O.bottom = null, O.raphael = w;
    var En = function (e) {
        var t = e.getBoundingClientRect(),
            n = e.ownerDocument,
            r = n.body,
            i = n.documentElement,
            s = i.clientTop || r.clientTop || 0,
            o = i.clientLeft || r.clientLeft || 0,
            u = t.top + (k.win.pageYOffset || i.scrollTop || r.scrollTop) - s,
            a = t.left + (k.win.pageXOffset || i.scrollLeft || r.scrollLeft) - o;
        return {
            y: u,
            x: a
        }
    };
    O.getElementByPoint = function (e, t) {
        var n = this,
            r = n.canvas,
            i = k.doc.elementFromPoint(e, t);
        if (k.win.opera && i.tagName == "svg") {
            var s = En(r),
                o = r.createSVGRect();
            o.x = e - s.x, o.y = t - s.y, o.width = o.height = 1;
            var u = r.getIntersectionList(o, null);
            u.length && (i = u[u.length - 1])
        }
        if (!i) return null;
        while (i.parentNode && i != r.parentNode && !i.raphael) i = i.parentNode;
        return i == n.canvas.parentNode && (i = r), i = i && i.raphael ? n.getById(i.raphaelid) : null, i
    }, O.getById = function (e) {
        var t = this.bottom;
        while (t) {
            if (t.id == e) return t;
            t = t.next
        }
        return null
    }, O.forEach = function (e, t) {
        var n = this.bottom;
        while (n) {
            if (e.call(t, n) === !1) return this;
            n = n.next
        }
        return this
    }, O.getElementsByPoint = function (e, t) {
        var n = this.set();
        return this.forEach(function (r) {
            r.isPointInside(e, t) && n.push(r)
        }), n
    }, yn.isPointInside = function (e, t) {
        var n = this.realPath = this.realPath || Lt[this.type](this);
        return w.isPointInsidePath(n, e, t)
    }, yn.getBBox = function (e) {
        if (this.removed) return {};
        var t = this._;
        if (e) {
            if (t.dirty || !t.bboxwt) this.realPath = Lt[this.type](this), t.bboxwt = Rt(this.realPath), t.bboxwt.toString = i, t.dirty = 0;
            return t.bboxwt
        }
        if (t.dirty || t.dirtyT || !t.bbox) {
            if (t.dirty || !this.realPath) t.bboxwt = 0, this.realPath = Lt[this.type](this);
            t.bbox = Rt(At(this.realPath, this.matrix)), t.bbox.toString = i, t.dirty = t.dirtyT = 0
        }
        return t.bbox
    }, yn.clone = function () {
        if (this.removed) return null;
        var e = this.paper[this.type]().attr(this.attr());
        return this.__set__ && this.__set__.push(e), e
    }, yn.glow = function (e) {
        if (this.type == "text") return null;
        e = e || {};
        var t = {
            width: (e.width || 10) + (+this.attr("stroke-width") || 1),
            fill: e.fill || !1,
            opacity: e.opacity || .5,
            offsetx: e.offsetx || 0,
            offsety: e.offsety || 0,
            color: e.color || "#000"
        }, n = t.width / 2,
            r = this.paper,
            i = r.set(),
            s = this.realPath || Lt[this.type](this);
        s = this.matrix ? At(s, this.matrix) : s;
        for (var o = 1; o < n + 1; o++) i.push(r.path(s).attr({
            stroke: t.color,
            fill: t.fill ? t.color : "none",
            "stroke-linejoin": "round",
            "stroke-linecap": "round",
            "stroke-width": +(t.width / n * o).toFixed(3),
            opacity: +(t.opacity / n).toFixed(3)
        }));
        return i.insertBefore(this).translate(t.offsetx, t.offsety)
    };
    var Sn = {}, xn = function (e, t, n, r, i, s, o, u, a) {
            return a == null ? p(e, t, n, r, i, s, o, u) : w.findDotsAtSegment(e, t, n, r, i, s, o, u, h(e, t, n, r, i, s, o, u, a))
        }, Tn = function (e, t) {
            return function (n, r, i) {
                n = Qt(n);
                var s, o, u, a, f = "",
                    l = {}, c, h = 0;
                for (var p = 0, d = n.length; p < d; p++) {
                    u = n[p];
                    if (u[0] == "M") s = +u[1], o = +u[2];
                    else {
                        a = xn(s, o, u[1], u[2], u[3], u[4], u[5], u[6]);
                        if (h + a > r) {
                            if (t && !l.start) {
                                c = xn(s, o, u[1], u[2], u[3], u[4], u[5], u[6], r - h), f += ["C" + c.start.x, c.start.y, c.m.x, c.m.y, c.x, c.y];
                                if (i) return f;
                                l.start = f, f = ["M" + c.x, c.y + "C" + c.n.x, c.n.y, c.end.x, c.end.y, u[5], u[6]].join(), h += a, s = +u[5], o = +u[6];
                                continue
                            }
                            if (!e && !t) return c = xn(s, o, u[1], u[2], u[3], u[4], u[5], u[6], r - h), {
                                x: c.x,
                                y: c.y,
                                alpha: c.alpha
                            }
                        }
                        h += a, s = +u[5], o = +u[6]
                    }
                    f += u.shift() + u
                }
                return l.end = f, c = e ? h : t ? l : w.findDotsAtSegment(s, o, u[0], u[1], u[2], u[3], u[4], u[5], 1), c.alpha && (c = {
                    x: c.x,
                    y: c.y,
                    alpha: c.alpha
                }), c
            }
        }, Nn = Tn(1),
        Cn = Tn(),
        kn = Tn(0, 1);
    w.getTotalLength = Nn, w.getPointAtLength = Cn, w.getSubpath = function (e, t, n) {
        if (this.getTotalLength(e) - n < 1e-6) return kn(e, t).end;
        var r = kn(e, n, 1);
        return t ? kn(r, t).end : r
    }, yn.getTotalLength = function () {
        if (this.type == "path") return this.node.getTotalLength ? this.node.getTotalLength() : Nn(this.attrs.path)
    }, yn.getPointAtLength = function (e) {
        if (this.type == "path") return Cn(this.attrs.path, e)
    }, yn.getSubpath = function (e, t) {
        if (this.type == "path") return w.getSubpath(this.attrs.path, e, t)
    };
    var Ln = w.easing_formulas = {
        linear: function (e) {
            return e
        },
        "<": function (e) {
            return V(e, 1.7)
        },
        ">": function (e) {
            return V(e, .48)
        },
        "<>": function (e) {
            var t = .48 - e / 1.04,
                n = U.sqrt(.1734 + t * t),
                r = n - t,
                i = V(X(r), 1 / 3) * (r < 0 ? -1 : 1),
                s = -n - t,
                o = V(X(s), 1 / 3) * (s < 0 ? -1 : 1),
                u = i + o + .5;
            return (1 - u) * 3 * u * u + u * u * u
        },
        backIn: function (e) {
            var t = 1.70158;
            return e * e * ((t + 1) * e - t)
        },
        backOut: function (e) {
            e -= 1;
            var t = 1.70158;
            return e * e * ((t + 1) * e + t) + 1
        },
        elastic: function (e) {
            return e == !! e ? e : V(2, -10 * e) * U.sin((e - .075) * 2 * $ / .3) + 1
        },
        bounce: function (e) {
            var t = 7.5625,
                n = 2.75,
                r;
            return e < 1 / n ? r = t * e * e : e < 2 / n ? (e -= 1.5 / n, r = t * e * e + .75) : e < 2.5 / n ? (e -= 2.25 / n, r = t * e * e + .9375) : (e -= 2.625 / n, r = t * e * e + .984375), r
        }
    };
    Ln.easeIn = Ln["ease-in"] = Ln["<"], Ln.easeOut = Ln["ease-out"] = Ln[">"], Ln.easeInOut = Ln["ease-in-out"] = Ln["<>"], Ln["back-in"] = Ln.backIn, Ln["back-out"] = Ln.backOut;
    var An = [],
        On = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function (e) {
            setTimeout(e, 16)
        }, Mn = function () {
            var e = +(new Date),
                n = 0;
            for (; n < An.length; n++) {
                var r = An[n];
                if (r.el.removed || r.paused) continue;
                var i = e - r.start,
                    s = r.ms,
                    o = r.easing,
                    u = r.from,
                    a = r.diff,
                    f = r.to,
                    l = r.t,
                    c = r.el,
                    h = {}, p, d = {}, v;
                r.initstatus ? (i = (r.initstatus * r.anim.top - r.prev) / (r.percent - r.prev) * s, r.status = r.initstatus, delete r.initstatus, r.stop && An.splice(n--, 1)) : r.status = (r.prev + (r.percent - r.prev) * (i / s)) / r.anim.top;
                if (i < 0) continue;
                if (i < s) {
                    var m = o(i / s);
                    for (var g in u)
                        if (u[C](g)) {
                            switch (ht[g]) {
                            case J:
                                p = +u[g] + m * s * a[g];
                                break;
                            case "colour":
                                p = "rgb(" + [_n(ot(u[g].r + m * s * a[g].r)), _n(ot(u[g].g + m * s * a[g].g)), _n(ot(u[g].b + m * s * a[g].b))].join(",") + ")";
                                break;
                            case "path":
                                p = [];
                                for (var y = 0, b = u[g].length; y < b; y++) {
                                    p[y] = [u[g][y][0]];
                                    for (var E = 1, S = u[g][y].length; E < S; E++) p[y][E] = +u[g][y][E] + m * s * a[g][y][E];
                                    p[y] = p[y].join(B)
                                }
                                p = p.join(B);
                                break;
                            case "transform":
                                if (a[g].real) {
                                    p = [];
                                    for (y = 0, b = u[g].length; y < b; y++) {
                                        p[y] = [u[g][y][0]];
                                        for (E = 1, S = u[g][y].length; E < S; E++) p[y][E] = u[g][y][E] + m * s * a[g][y][E]
                                    }
                                } else {
                                    var x = function (e) {
                                        return +u[g][e] + m * s * a[g][e]
                                    };
                                    p = [
                                        ["m", x(0), x(1), x(2), x(3), x(4), x(5)]
                                    ]
                                }
                                break;
                            case "csv":
                                if (g == "clip-rect") {
                                    p = [], y = 4;
                                    while (y--) p[y] = +u[g][y] + m * s * a[g][y]
                                }
                                break;
                            default:
                                var T = [][D](u[g]);
                                p = [], y = c.paper.customAttributes[g].length;
                                while (y--) p[y] = +T[y] + m * s * a[g][y]
                            }
                            h[g] = p
                        }
                    c.attr(h),
                    function (e, t, n) {
                        setTimeout(function () {
                            eve("raphael.anim.frame." + e, t, n)
                        })
                    }(c.id, c, r.anim)
                } else {
                    (function (e, t, n) {
                        setTimeout(function () {
                            eve("raphael.anim.frame." + t.id, t, n), eve("raphael.anim.finish." + t.id, t, n), w.is(e, "function") && e.call(t)
                        })
                    })(r.callback, c, r.anim), c.attr(f), An.splice(n--, 1);
                    if (r.repeat > 1 && !r.next) {
                        for (v in f) f[C](v) && (d[v] = r.totalOrigin[v]);
                        r.el.attr(d), t(r.anim, r.el, r.anim.percents[0], null, r.totalOrigin, r.repeat - 1)
                    }
                    r.next && !r.stop && t(r.anim, r.el, r.next, null, r.totalOrigin, r.repeat)
                }
            }
            w.svg && c && c.paper && c.paper.safari(), An.length && On(Mn)
        }, _n = function (e) {
            return e > 255 ? 255 : e < 0 ? 0 : e
        };
    yn.animateWith = function (e, r, i, s, o, u) {
        var a = this;
        if (a.removed) return u && u.call(a), a;
        var f = i instanceof n ? i : w.animation(i, s, o, u),
            l, c;
        t(f, a, f.percents[0], null, a.attr());
        for (var h = 0, p = An.length; h < p; h++)
            if (An[h].anim == r && An[h].el == e) {
                An[p - 1].start = An[h].start;
                break
            }
        return a
    }, yn.onAnimation = function (e) {
        return e ? eve.on("raphael.anim.frame." + this.id, e) : eve.unbind("raphael.anim.frame." + this.id), this
    }, n.prototype.delay = function (e) {
        var t = new n(this.anim, this.ms);
        return t.times = this.times, t.del = +e || 0, t
    }, n.prototype.repeat = function (e) {
        var t = new n(this.anim, this.ms);
        return t.del = this.del, t.times = U.floor(z(e, 0)) || 1, t
    }, w.animation = function (e, t, r, i) {
        if (e instanceof n) return e;
        if (w.is(r, "function") || !r) i = i || r || null, r = null;
        e = Object(e), t = +t || 0;
        var s = {}, o, u;
        for (u in e) e[C](u) && at(u) != u && at(u) + "%" != u && (o = !0, s[u] = e[u]);
        return o ? (r && (s.easing = r), i && (s.callback = i), new n({
            100: s
        }, t)) : new n(e, t)
    }, yn.animate = function (e, r, i, s) {
        var o = this;
        if (o.removed) return s && s.call(o), o;
        var u = e instanceof n ? e : w.animation(e, r, i, s);
        return t(u, o, u.percents[0], null, o.attr()), o
    }, yn.setTime = function (e, t) {
        return e && t != null && this.status(e, W(t, e.ms) / e.ms), this
    }, yn.status = function (e, n) {
        var r = [],
            i = 0,
            s, o;
        if (n != null) return t(e, this, -1, W(n, 1)), this;
        s = An.length;
        for (; i < s; i++) {
            o = An[i];
            if (o.el.id == this.id && (!e || o.anim == e)) {
                if (e) return o.status;
                r.push({
                    anim: o.anim,
                    status: o.status
                })
            }
        }
        return e ? 0 : r
    }, yn.pause = function (e) {
        for (var t = 0; t < An.length; t++) An[t].el.id == this.id && (!e || An[t].anim == e) && eve("raphael.anim.pause." + this.id, this, An[t].anim) !== !1 && (An[t].paused = !0);
        return this
    }, yn.resume = function (e) {
        for (var t = 0; t < An.length; t++)
            if (An[t].el.id == this.id && (!e || An[t].anim == e)) {
                var n = An[t];
                eve("raphael.anim.resume." + this.id, this, n.anim) !== !1 && (delete n.paused, this.status(n.anim, n.status))
            }
        return this
    }, yn.stop = function (e) {
        for (var t = 0; t < An.length; t++) An[t].el.id == this.id && (!e || An[t].anim == e) && eve("raphael.anim.stop." + this.id, this, An[t].anim) !== !1 && An.splice(t--, 1);
        return this
    }, eve.on("raphael.remove", e), eve.on("raphael.clear", e), yn.toString = function () {
        return "Raphals object"
    };
    var Dn = function (e) {
        this.items = [], this.length = 0, this.type = "set";
        if (e)
            for (var t = 0, n = e.length; t < n; t++) e[t] && (e[t].constructor == yn.constructor || e[t].constructor == Dn) && (this[this.items.length] = this.items[this.items.length] = e[t], this.length++)
    }, Pn = Dn.prototype;
    Pn.push = function () {
        var e, t;
        for (var n = 0, r = arguments.length; n < r; n++) e = arguments[n], e && (e.constructor == yn.constructor || e.constructor == Dn) && (t = this.items.length, this[t] = this.items[t] = e, this.length++);
        return this
    }, Pn.pop = function () {
        return this.length && delete this[this.length--], this.items.pop()
    }, Pn.forEach = function (e, t) {
        for (var n = 0, r = this.items.length; n < r; n++)
            if (e.call(t, this.items[n], n) === !1) return this;
        return this
    };
    for (var Hn in yn) yn[C](Hn) && (Pn[Hn] = function (e) {
        return function () {
            var t = arguments;
            return this.forEach(function (n) {
                n[e][_](n, t)
            })
        }
    }(Hn));
    Pn.attr = function (e, t) {
        if (e && w.is(e, Q) && w.is(e[0], "object"))
            for (var n = 0, r = e.length; n < r; n++) this.items[n].attr(e[n]);
        else
            for (var i = 0, s = this.items.length; i < s; i++) this.items[i].attr(e, t);
        return this
    }, Pn.clear = function () {
        while (this.length) this.pop()
    }, Pn.splice = function (e, t, n) {
        e = e < 0 ? z(this.length + e, 0) : e, t = z(0, W(this.length - e, t));
        var r = [],
            i = [],
            s = [],
            o;
        for (o = 2; o < arguments.length; o++) s.push(arguments[o]);
        for (o = 0; o < t; o++) i.push(this[e + o]);
        for (; o < this.length - e; o++) r.push(this[e + o]);
        var u = s.length;
        for (o = 0; o < u + r.length; o++) this.items[e + o] = this[e + o] = o < u ? s[o] : r[o - u];
        o = this.items.length = this.length -= t - u;
        while (this[o]) delete this[o++];
        return new Dn(i)
    }, Pn.exclude = function (e) {
        for (var t = 0, n = this.length; t < n; t++)
            if (this[t] == e) return this.splice(t, 1), !0
    }, Pn.animate = function (e, t, n, r) {
        (w.is(n, "function") || !n) && (r = n || null);
        var i = this.items.length,
            s = i,
            o, u = this,
            a;
        if (!i) return this;
        r && (a = function () {
            !--i && r.call(u)
        }), n = w.is(n, K) ? n : a;
        var f = w.animation(e, t, n, a);
        o = this.items[--s].animate(f);
        while (s--) this.items[s] && !this.items[s].removed && this.items[s].animateWith(o, f, f);
        return this
    }, Pn.insertAfter = function (e) {
        var t = this.items.length;
        while (t--) this.items[t].insertAfter(e);
        return this
    }, Pn.getBBox = function () {
        var e = [],
            t = [],
            n = [],
            r = [];
        for (var i = this.items.length; i--;)
            if (!this.items[i].removed) {
                var s = this.items[i].getBBox();
                e.push(s.x), t.push(s.y), n.push(s.x + s.width), r.push(s.y + s.height)
            }
        return e = W[_](0, e), t = W[_](0, t), n = z[_](0, n), r = z[_](0, r), {
            x: e,
            y: t,
            x2: n,
            y2: r,
            width: n - e,
            height: r - t
        }
    }, Pn.clone = function (e) {
        e = new Dn;
        for (var t = 0, n = this.items.length; t < n; t++) e.push(this.items[t].clone());
        return e
    }, Pn.toString = function () {
        return "Raphals set"
    }, w.registerFont = function (e) {
        if (!e.face) return e;
        this.fonts = this.fonts || {};
        var t = {
            w: e.w,
            face: {},
            glyphs: {}
        }, n = e.face["font-family"];
        for (var r in e.face) e.face[C](r) && (t.face[r] = e.face[r]);
        this.fonts[n] ? this.fonts[n].push(t) : this.fonts[n] = [t];
        if (!e.svg) {
            t.face["units-per-em"] = ft(e.face["units-per-em"], 10);
            for (var i in e.glyphs)
                if (e.glyphs[C](i)) {
                    var s = e.glyphs[i];
                    t.glyphs[i] = {
                        w: s.w,
                        k: {},
                        d: s.d && "M" + s.d.replace(/[mlcxtrv]/g, function (e) {
                            return {
                                l: "L",
                                c: "C",
                                x: "z",
                                t: "m",
                                r: "l",
                                v: "c"
                            }[e] || "M"
                        }) + "z"
                    };
                    if (s.k)
                        for (var o in s.k) s[C](o) && (t.glyphs[i].k[o] = s.k[o])
                }
        }
        return e
    }, O.getFont = function (e, t, n, r) {
        r = r || "normal", n = n || "normal", t = +t || {
            normal: 400,
            bold: 700,
            lighter: 300,
            bolder: 800
        }[t] || 400;
        if ( !! w.fonts) {
            var i = w.fonts[e];
            if (!i) {
                var s = new RegExp("(^|\\s)" + e.replace(/[^\w\d\s+!~.:_-]/g, H) + "(\\s|$)", "i");
                for (var o in w.fonts)
                    if (w.fonts[C](o) && s.test(o)) {
                        i = w.fonts[o];
                        break
                    }
            }
            var u;
            if (i)
                for (var a = 0, f = i.length; a < f; a++) {
                    u = i[a];
                    if (u.face["font-weight"] == t && (u.face["font-style"] == n || !u.face["font-style"]) && u.face["font-stretch"] == r) break
                }
            return u
        }
    }, O.print = function (e, t, n, r, i, s, o) {
        s = s || "middle", o = z(W(o || 0, 1), -1);
        var u = j(n)[F](H),
            a = 0,
            f = 0,
            l = H,
            c;
        w.is(r, n) && (r = this.getFont(r));
        if (r) {
            c = (i || 16) / r.face["units-per-em"];
            var h = r.face.bbox[F](S),
                p = +h[0],
                d = h[3] - h[1],
                v = 0,
                m = +h[1] + (s == "baseline" ? d + +r.face.descent : d / 2);
            for (var g = 0, y = u.length; g < y; g++) {
                if (u[g] == "\n") a = 0, E = 0, f = 0, v += d;
                else {
                    var b = f && r.glyphs[u[g - 1]] || {}, E = r.glyphs[u[g]];
                    a += f ? (b.w || r.w) + (b.k && b.k[u[g]] || 0) + r.w * o : 0, f = 1
                }
                E && E.d && (l += w.transformPath(E.d, ["t", a * c, v * c, "s", c, c, p, m, "t", (e - p) / c, (t - m) / c]))
            }
        }
        return this.path(l).attr({
            fill: "#000",
            stroke: "none"
        })
    }, O.add = function (e) {
        if (w.is(e, "array")) {
            var t = this.set(),
                n = 0,
                r = e.length,
                i;
            for (; n < r; n++) i = e[n] || {}, x[C](i.type) && t.push(this[i.type]().attr(i))
        }
        return t
    }, w.format = function (e, t) {
        var n = w.is(t, Q) ? [0][D](t) : arguments;
        return e && w.is(e, K) && n.length - 1 && (e = e.replace(T, function (e, t) {
            return n[++t] == null ? H : n[t]
        })), e || H
    }, w.fullfill = function () {
        var e = /\{([^\}]+)\}/g,
            t = /(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g,
            n = function (e, n, r) {
                var i = r;
                return n.replace(t, function (e, t, n, r, s) {
                    t = t || r, i && (t in i && (i = i[t]), typeof i == "function" && s && (i = i()))
                }), i = (i == null || i == r ? e : i) + "", i
            };
        return function (t, r) {
            return String(t).replace(e, function (e, t) {
                return n(e, t, r)
            })
        }
    }(), w.ninja = function () {
        return L.was ? k.win.Raphael = L.is : delete Raphael, w
    }, w.st = Pn,
    function (e, t, n) {
        function r() {
            /in/.test(e.readyState) ? setTimeout(r, 9) : w.eve("raphael.DOMload")
        }
        e.readyState == null && e.addEventListener && (e.addEventListener(t, n = function () {
            e.removeEventListener(t, n, !1), e.readyState = "complete"
        }, !1), e.readyState = "loading"), r()
    }(document, "DOMContentLoaded"), L.was ? k.win.Raphael = w : Raphael = w, eve.on("raphael.DOMload", function () {
        E = !0
    })
}(), window.Raphael.svg && function (e) {
    var t = "hasOwnProperty",
        n = String,
        r = parseFloat,
        i = parseInt,
        s = Math,
        o = s.max,
        u = s.abs,
        a = s.pow,
        f = /[, ]+/,
        l = e.eve,
        c = "",
        h = " ",
        p = "http://www.w3.org/1999/xlink",
        d = {
            block: "M5,0 0,2.5 5,5z",
            classic: "M5,0 0,2.5 5,5 3.5,3 3.5,2z",
            diamond: "M2.5,0 5,2.5 2.5,5 0,2.5z",
            open: "M6,1 1,3.5 6,6",
            oval: "M2.5,0A2.5,2.5,0,0,1,2.5,5 2.5,2.5,0,0,1,2.5,0z"
        }, v = {};
    e.toString = function () {
        return "Your browser supports SVG.\nYou are running Raphal " + this.version
    };
    var m = function (r, i) {
        if (i) {
            typeof r == "string" && (r = m(r));
            for (var s in i) i[t](s) && (s.substring(0, 6) == "xlink:" ? r.setAttributeNS(p, s.substring(6), n(i[s])) : r.setAttribute(s, n(i[s])))
        } else r = e._g.doc.createElementNS("http://www.w3.org/2000/svg", r), r.style && (r.style.webkitTapHighlightColor = "rgba(0,0,0,0)");
        return r
    }, g = function (t, i) {
            var f = "linear",
                l = t.id + i,
                h = .5,
                p = .5,
                d = t.node,
                v = t.paper,
                g = d.style,
                y = e._g.doc.getElementById(l);
            if (!y) {
                i = n(i).replace(e._radial_gradient, function (e, t, n) {
                    f = "radial";
                    if (t && n) {
                        h = r(t), p = r(n);
                        var i = (p > .5) * 2 - 1;
                        a(h - .5, 2) + a(p - .5, 2) > .25 && (p = s.sqrt(.25 - a(h - .5, 2)) * i + .5) && p != .5 && (p = p.toFixed(5) - 1e-5 * i)
                    }
                    return c
                }), i = i.split(/\s*\-\s*/);
                if (f == "linear") {
                    var b = i.shift();
                    b = -r(b);
                    if (isNaN(b)) return null;
                    var w = [0, 0, s.cos(e.rad(b)), s.sin(e.rad(b))],
                        E = 1 / (o(u(w[2]), u(w[3])) || 1);
                    w[2] *= E, w[3] *= E, w[2] < 0 && (w[0] = -w[2], w[2] = 0), w[3] < 0 && (w[1] = -w[3], w[3] = 0)
                }
                var S = e._parseDots(i);
                if (!S) return null;
                l = l.replace(/[\(\)\s,\xb0#]/g, "_"), t.gradient && l != t.gradient.id && (v.defs.removeChild(t.gradient), delete t.gradient);
                if (!t.gradient) {
                    y = m(f + "Gradient", {
                        id: l
                    }), t.gradient = y, m(y, f == "radial" ? {
                        fx: h,
                        fy: p
                    } : {
                        x1: w[0],
                        y1: w[1],
                        x2: w[2],
                        y2: w[3],
                        gradientTransform: t.matrix.invert()
                    }), v.defs.appendChild(y);
                    for (var x = 0, T = S.length; x < T; x++) y.appendChild(m("stop", {
                        offset: S[x].offset ? S[x].offset : x ? "100%" : "0%",
                        "stop-color": S[x].color || "#fff"
                    }))
                }
            }
            return m(d, {
                fill: "url(#" + l + ")",
                opacity: 1,
                "fill-opacity": 1
            }), g.fill = c, g.opacity = 1, g.fillOpacity = 1, 1
        }, y = function (e) {
            var t = e.getBBox(1);
            m(e.pattern, {
                patternTransform: e.matrix.invert() + " translate(" + t.x + "," + t.y + ")"
            })
        }, b = function (r, i, s) {
            if (r.type == "path") {
                var o = n(i).toLowerCase().split("-"),
                    u = r.paper,
                    a = s ? "end" : "start",
                    f = r.node,
                    l = r.attrs,
                    h = l["stroke-width"],
                    p = o.length,
                    g = "classic",
                    y, b, w, E, S, x = 3,
                    T = 3,
                    N = 5;
                while (p--) switch (o[p]) {
                case "block":
                case "classic":
                case "oval":
                case "diamond":
                case "open":
                case "none":
                    g = o[p];
                    break;
                case "wide":
                    T = 5;
                    break;
                case "narrow":
                    T = 2;
                    break;
                case "long":
                    x = 5;
                    break;
                case "short":
                    x = 2
                }
                g == "open" ? (x += 2, T += 2, N += 2, w = 1, E = s ? 4 : 1, S = {
                    fill: "none",
                    stroke: l.stroke
                }) : (E = w = x / 2, S = {
                    fill: l.stroke,
                    stroke: "none"
                }), r._.arrows ? s ? (r._.arrows.endPath && v[r._.arrows.endPath]--, r._.arrows.endMarker && v[r._.arrows.endMarker]--) : (r._.arrows.startPath && v[r._.arrows.startPath]--, r._.arrows.startMarker && v[r._.arrows.startMarker]--) : r._.arrows = {};
                if (g != "none") {
                    var C = "raphael-marker-" + g,
                        k = "raphael-marker-" + a + g + x + T;
                    e._g.doc.getElementById(C) ? v[C]++ : (u.defs.appendChild(m(m("path"), {
                        "stroke-linecap": "round",
                        d: d[g],
                        id: C
                    })), v[C] = 1);
                    var L = e._g.doc.getElementById(k),
                        A;
                    L ? (v[k]++, A = L.getElementsByTagName("use")[0]) : (L = m(m("marker"), {
                        id: k,
                        markerHeight: T,
                        markerWidth: x,
                        orient: "auto",
                        refX: E,
                        refY: T / 2
                    }), A = m(m("use"), {
                        "xlink:href": "#" + C,
                        transform: (s ? "rotate(180 " + x / 2 + " " + T / 2 + ") " : c) + "scale(" + x / N + "," + T / N + ")",
                        "stroke-width": (1 / ((x / N + T / N) / 2)).toFixed(4)
                    }), L.appendChild(A), u.defs.appendChild(L), v[k] = 1), m(A, S);
                    var O = w * (g != "diamond" && g != "oval");
                    s ? (y = r._.arrows.startdx * h || 0, b = e.getTotalLength(l.path) - O * h) : (y = O * h, b = e.getTotalLength(l.path) - (r._.arrows.enddx * h || 0)), S = {}, S["marker-" + a] = "url(#" + k + ")";
                    if (b || y) S.d = Raphael.getSubpath(l.path, y, b);
                    m(f, S), r._.arrows[a + "Path"] = C, r._.arrows[a + "Marker"] = k, r._.arrows[a + "dx"] = O, r._.arrows[a + "Type"] = g, r._.arrows[a + "String"] = i
                } else s ? (y = r._.arrows.startdx * h || 0, b = e.getTotalLength(l.path) - y) : (y = 0, b = e.getTotalLength(l.path) - (r._.arrows.enddx * h || 0)), r._.arrows[a + "Path"] && m(f, {
                    d: Raphael.getSubpath(l.path, y, b)
                }), delete r._.arrows[a + "Path"], delete r._.arrows[a + "Marker"], delete r._.arrows[a + "dx"], delete r._.arrows[a + "Type"], delete r._.arrows[a + "String"];
                for (S in v)
                    if (v[t](S) && !v[S]) {
                        var M = e._g.doc.getElementById(S);
                        M && M.parentNode.removeChild(M)
                    }
            }
        }, w = {
            "": [0],
            none: [0],
            "-": [3, 1],
            ".": [1, 1],
            "-.": [3, 1, 1, 1],
            "-..": [3, 1, 1, 1, 1, 1],
            ". ": [1, 3],
            "- ": [4, 3],
            "--": [8, 3],
            "- .": [4, 3, 1, 3],
            "--.": [8, 3, 1, 3],
            "--..": [8, 3, 1, 3, 1, 3]
        }, E = function (e, t, r) {
            t = w[n(t).toLowerCase()];
            if (t) {
                var i = e.attrs["stroke-width"] || "1",
                    s = {
                        round: i,
                        square: i,
                        butt: 0
                    }[e.attrs["stroke-linecap"] || r["stroke-linecap"]] || 0,
                    o = [],
                    u = t.length;
                while (u--) o[u] = t[u] * i + (u % 2 ? 1 : -1) * s;
                m(e.node, {
                    "stroke-dasharray": o.join(",")
                })
            }
        }, S = function (r, s) {
            var a = r.node,
                l = r.attrs,
                h = a.style.visibility;
            a.style.visibility = "hidden";
            for (var d in s)
                if (s[t](d)) {
                    if (!e._availableAttrs[t](d)) continue;
                    var v = s[d];
                    l[d] = v;
                    switch (d) {
                    case "blur":
                        r.blur(v);
                        break;
                    case "href":
                    case "title":
                    case "target":
                        var w = a.parentNode;
                        if (w.tagName.toLowerCase() != "a") {
                            var S = m("a");
                            w.insertBefore(S, a), S.appendChild(a), w = S
                        }
                        d == "target" ? w.setAttributeNS(p, "show", v == "blank" ? "new" : v) : w.setAttributeNS(p, d, v);
                        break;
                    case "cursor":
                        a.style.cursor = v;
                        break;
                    case "transform":
                        r.transform(v);
                        break;
                    case "arrow-start":
                        b(r, v);
                        break;
                    case "arrow-end":
                        b(r, v, 1);
                        break;
                    case "clip-rect":
                        var x = n(v).split(f);
                        if (x.length == 4) {
                            r.clip && r.clip.parentNode.parentNode.removeChild(r.clip.parentNode);
                            var N = m("clipPath"),
                                C = m("rect");
                            N.id = e.createUUID(), m(C, {
                                x: x[0],
                                y: x[1],
                                width: x[2],
                                height: x[3]
                            }), N.appendChild(C), r.paper.defs.appendChild(N), m(a, {
                                "clip-path": "url(#" + N.id + ")"
                            }), r.clip = C
                        }
                        if (!v) {
                            var k = a.getAttribute("clip-path");
                            if (k) {
                                var L = e._g.doc.getElementById(k.replace(/(^url\(#|\)$)/g, c));
                                L && L.parentNode.removeChild(L), m(a, {
                                    "clip-path": c
                                }), delete r.clip
                            }
                        }
                        break;
                    case "path":
                        r.type == "path" && (m(a, {
                            d: v ? l.path = e._pathToAbsolute(v) : "M0,0"
                        }), r._.dirty = 1, r._.arrows && ("startString" in r._.arrows && b(r, r._.arrows.startString), "endString" in r._.arrows && b(r, r._.arrows.endString, 1)));
                        break;
                    case "width":
                        a.setAttribute(d, v), r._.dirty = 1;
                        if (!l.fx) break;
                        d = "x", v = l.x;
                    case "x":
                        l.fx && (v = -l.x - (l.width || 0));
                    case "rx":
                        if (d == "rx" && r.type == "rect") break;
                    case "cx":
                        a.setAttribute(d, v), r.pattern && y(r), r._.dirty = 1;
                        break;
                    case "height":
                        a.setAttribute(d, v), r._.dirty = 1;
                        if (!l.fy) break;
                        d = "y", v = l.y;
                    case "y":
                        l.fy && (v = -l.y - (l.height || 0));
                    case "ry":
                        if (d == "ry" && r.type == "rect") break;
                    case "cy":
                        a.setAttribute(d, v), r.pattern && y(r), r._.dirty = 1;
                        break;
                    case "r":
                        r.type == "rect" ? m(a, {
                            rx: v,
                            ry: v
                        }) : a.setAttribute(d, v), r._.dirty = 1;
                        break;
                    case "src":
                        r.type == "image" && a.setAttributeNS(p, "href", v);
                        break;
                    case "stroke-width":
                        if (r._.sx != 1 || r._.sy != 1) v /= o(u(r._.sx), u(r._.sy)) || 1;
                        r.paper._vbSize && (v *= r.paper._vbSize), a.setAttribute(d, v), l["stroke-dasharray"] && E(r, l["stroke-dasharray"], s), r._.arrows && ("startString" in r._.arrows && b(r, r._.arrows.startString), "endString" in r._.arrows && b(r, r._.arrows.endString, 1));
                        break;
                    case "stroke-dasharray":
                        E(r, v, s);
                        break;
                    case "fill":
                        var A = n(v).match(e._ISURL);
                        if (A) {
                            N = m("pattern");
                            var O = m("image");
                            N.id = e.createUUID(), m(N, {
                                x: 0,
                                y: 0,
                                patternUnits: "userSpaceOnUse",
                                height: 1,
                                width: 1
                            }), m(O, {
                                x: 0,
                                y: 0,
                                "xlink:href": A[1]
                            }), N.appendChild(O),
                            function (t) {
                                e._preload(A[1], function () {
                                    var e = this.offsetWidth,
                                        n = this.offsetHeight;
                                    m(t, {
                                        width: e,
                                        height: n
                                    }), m(O, {
                                        width: e,
                                        height: n
                                    }), r.paper.safari()
                                })
                            }(N), r.paper.defs.appendChild(N), m(a, {
                                fill: "url(#" + N.id + ")"
                            }), r.pattern = N, r.pattern && y(r);
                            break
                        }
                        var M = e.getRGB(v);
                        if (!M.error) delete s.gradient, delete l.gradient, !e.is(l.opacity, "undefined") && e.is(s.opacity, "undefined") && m(a, {
                            opacity: l.opacity
                        }), !e.is(l["fill-opacity"], "undefined") && e.is(s["fill-opacity"], "undefined") && m(a, {
                            "fill-opacity": l["fill-opacity"]
                        });
                        else if ((r.type == "circle" || r.type == "ellipse" || n(v).charAt() != "r") && g(r, v)) {
                            if ("opacity" in l || "fill-opacity" in l) {
                                var _ = e._g.doc.getElementById(a.getAttribute("fill").replace(/^url\(#|\)$/g, c));
                                if (_) {
                                    var D = _.getElementsByTagName("stop");
                                    m(D[D.length - 1], {
                                        "stop-opacity": ("opacity" in l ? l.opacity : 1) * ("fill-opacity" in l ? l["fill-opacity"] : 1)
                                    })
                                }
                            }
                            l.gradient = v, l.fill = "none";
                            break
                        }
                        M[t]("opacity") && m(a, {
                            "fill-opacity": M.opacity > 1 ? M.opacity / 100 : M.opacity
                        });
                    case "stroke":
                        M = e.getRGB(v), a.setAttribute(d, M.hex), d == "stroke" && M[t]("opacity") && m(a, {
                            "stroke-opacity": M.opacity > 1 ? M.opacity / 100 : M.opacity
                        }), d == "stroke" && r._.arrows && ("startString" in r._.arrows && b(r, r._.arrows.startString), "endString" in r._.arrows && b(r, r._.arrows.endString, 1));
                        break;
                    case "gradient":
                        (r.type == "circle" || r.type == "ellipse" || n(v).charAt() != "r") && g(r, v);
                        break;
                    case "opacity":
                        l.gradient && !l[t]("stroke-opacity") && m(a, {
                            "stroke-opacity": v > 1 ? v / 100 : v
                        });
                    case "fill-opacity":
                        if (l.gradient) {
                            _ = e._g.doc.getElementById(a.getAttribute("fill").replace(/^url\(#|\)$/g, c)), _ && (D = _.getElementsByTagName("stop"), m(D[D.length - 1], {
                                "stop-opacity": v
                            }));
                            break
                        };
                    default:
                        d == "font-size" && (v = i(v, 10) + "px");
                        var P = d.replace(/(\-.)/g, function (e) {
                            return e.substring(1).toUpperCase()
                        });
                        a.style[P] = v, r._.dirty = 1, a.setAttribute(d, v)
                    }
                }
            T(r, s), a.style.visibility = h
        }, x = 1.2,
        T = function (r, s) {
            if (r.type == "text" && !! (s[t]("text") || s[t]("font") || s[t]("font-size") || s[t]("x") || s[t]("y"))) {
                var o = r.attrs,
                    u = r.node,
                    a = u.firstChild ? i(e._g.doc.defaultView.getComputedStyle(u.firstChild, c).getPropertyValue("font-size"), 10) : 10;
                if (s[t]("text")) {
                    o.text = s.text;
                    while (u.firstChild) u.removeChild(u.firstChild);
                    var f = n(s.text).split("\n"),
                        l = [],
                        h;
                    for (var p = 0, d = f.length; p < d; p++) h = m("tspan"), p && m(h, {
                        dy: a * x,
                        x: o.x
                    }), h.appendChild(e._g.doc.createTextNode(f[p])), u.appendChild(h), l[p] = h
                } else {
                    l = u.getElementsByTagName("tspan");
                    for (p = 0, d = l.length; p < d; p++) p ? m(l[p], {
                        dy: a * x,
                        x: o.x
                    }) : m(l[0], {
                        dy: 0
                    })
                }
                m(u, {
                    x: o.x,
                    y: o.y
                }), r._.dirty = 1;
                var v = r._getBBox(),
                    g = o.y - (v.y + v.height / 2);
                g && e.is(g, "finite") && m(l[0], {
                    dy: g
                })
            }
        }, N = function (t, n) {
            var r = 0,
                i = 0;
            this[0] = this.node = t, t.raphael = !0, this.id = e._oid++, t.raphaelid = this.id, this.matrix = e.matrix(), this.realPath = null, this.paper = n, this.attrs = this.attrs || {}, this._ = {
                transform: [],
                sx: 1,
                sy: 1,
                deg: 0,
                dx: 0,
                dy: 0,
                dirty: 1
            }, !n.bottom && (n.bottom = this), this.prev = n.top, n.top && (n.top.next = this), n.top = this, this.next = null
        }, C = e.el;
    N.prototype = C, C.constructor = N, e._engine.path = function (e, t) {
        var n = m("path");
        t.canvas && t.canvas.appendChild(n);
        var r = new N(n, t);
        return r.type = "path", S(r, {
            fill: "none",
            stroke: "#000",
            path: e
        }), r
    }, C.rotate = function (e, t, i) {
        if (this.removed) return this;
        e = n(e).split(f), e.length - 1 && (t = r(e[1]), i = r(e[2])), e = r(e[0]), i == null && (t = i);
        if (t == null || i == null) {
            var s = this.getBBox(1);
            t = s.x + s.width / 2, i = s.y + s.height / 2
        }
        return this.transform(this._.transform.concat([
            ["r", e, t, i]
        ])), this
    }, C.scale = function (e, t, i, s) {
        if (this.removed) return this;
        e = n(e).split(f), e.length - 1 && (t = r(e[1]), i = r(e[2]), s = r(e[3])), e = r(e[0]), t == null && (t = e), s == null && (i = s);
        if (i == null || s == null) var o = this.getBBox(1);
        return i = i == null ? o.x + o.width / 2 : i, s = s == null ? o.y + o.height / 2 : s, this.transform(this._.transform.concat([
            ["s", e, t, i, s]
        ])), this
    }, C.translate = function (e, t) {
        return this.removed ? this : (e = n(e).split(f), e.length - 1 && (t = r(e[1])), e = r(e[0]) || 0, t = +t || 0, this.transform(this._.transform.concat([
            ["t", e, t]
        ])), this)
    }, C.transform = function (n) {
        var r = this._;
        if (n == null) return r.transform;
        e._extractTransform(this, n), this.clip && m(this.clip, {
            transform: this.matrix.invert()
        }), this.pattern && y(this), this.node && m(this.node, {
            transform: this.matrix
        });
        if (r.sx != 1 || r.sy != 1) {
            var i = this.attrs[t]("stroke-width") ? this.attrs["stroke-width"] : 1;
            this.attr({
                "stroke-width": i
            })
        }
        return this
    }, C.hide = function () {
        return !this.removed && this.paper.safari(this.node.style.display = "none"), this
    }, C.show = function () {
        return !this.removed && this.paper.safari(this.node.style.display = ""), this
    }, C.remove = function () {
        if (!this.removed && !! this.node.parentNode) {
            var t = this.paper;
            t.__set__ && t.__set__.exclude(this), l.unbind("raphael.*.*." + this.id), this.gradient && t.defs.removeChild(this.gradient), e._tear(this, t), this.node.parentNode.tagName.toLowerCase() == "a" ? this.node.parentNode.parentNode.removeChild(this.node.parentNode) : this.node.parentNode.removeChild(this.node);
            for (var n in this) this[n] = typeof this[n] == "function" ? e._removedFactory(n) : null;
            this.removed = !0
        }
    }, C._getBBox = function () {
        if (this.node.style.display == "none") {
            this.show();
            var e = !0
        }
        var t = {};
        try {
            t = this.node.getBBox()
        } catch (n) {} finally {
            t = t || {}
        }
        return e && this.hide(), t
    }, C.attr = function (n, r) {
        if (this.removed) return this;
        if (n == null) {
            var i = {};
            for (var s in this.attrs) this.attrs[t](s) && (i[s] = this.attrs[s]);
            return i.gradient && i.fill == "none" && (i.fill = i.gradient) && delete i.gradient, i.transform = this._.transform, i
        }
        if (r == null && e.is(n, "string")) {
            if (n == "fill" && this.attrs.fill == "none" && this.attrs.gradient) return this.attrs.gradient;
            if (n == "transform") return this._.transform;
            var o = n.split(f),
                u = {};
            for (var a = 0, c = o.length; a < c; a++) n = o[a], n in this.attrs ? u[n] = this.attrs[n] : e.is(this.paper.customAttributes[n], "function") ? u[n] = this.paper.customAttributes[n].def : u[n] = e._availableAttrs[n];
            return c - 1 ? u : u[o[0]]
        }
        if (r == null && e.is(n, "array")) {
            u = {};
            for (a = 0, c = n.length; a < c; a++) u[n[a]] = this.attr(n[a]);
            return u
        }
        if (r != null) {
            var h = {};
            h[n] = r
        } else n != null && e.is(n, "object") && (h = n);
        for (var p in h) l("raphael.attr." + p + "." + this.id, this, h[p]);
        for (p in this.paper.customAttributes)
            if (this.paper.customAttributes[t](p) && h[t](p) && e.is(this.paper.customAttributes[p], "function")) {
                var d = this.paper.customAttributes[p].apply(this, [].concat(h[p]));
                this.attrs[p] = h[p];
                for (var v in d) d[t](v) && (h[v] = d[v])
            }
        return S(this, h), this
    }, C.toFront = function () {
        if (this.removed) return this;
        this.node.parentNode.tagName.toLowerCase() == "a" ? this.node.parentNode.parentNode.appendChild(this.node.parentNode) : this.node.parentNode.appendChild(this.node);
        var t = this.paper;
        return t.top != this && e._tofront(this, t), this
    }, C.toBack = function () {
        if (this.removed) return this;
        var t = this.node.parentNode;
        t.tagName.toLowerCase() == "a" ? t.parentNode.insertBefore(this.node.parentNode, this.node.parentNode.parentNode.firstChild) : t.firstChild != this.node && t.insertBefore(this.node, this.node.parentNode.firstChild), e._toback(this, this.paper);
        var n = this.paper;
        return this
    }, C.insertAfter = function (t) {
        if (this.removed) return this;
        var n = t.node || t[t.length - 1].node;
        return n.nextSibling ? n.parentNode.insertBefore(this.node, n.nextSibling) : n.parentNode.appendChild(this.node), e._insertafter(this, t, this.paper), this
    }, C.insertBefore = function (t) {
        if (this.removed) return this;
        var n = t.node || t[0].node;
        return n.parentNode.insertBefore(this.node, n), e._insertbefore(this, t, this.paper), this
    }, C.blur = function (t) {
        var n = this;
        if (+t !== 0) {
            var r = m("filter"),
                i = m("feGaussianBlur");
            n.attrs.blur = t, r.id = e.createUUID(), m(i, {
                stdDeviation: +t || 1.5
            }), r.appendChild(i), n.paper.defs.appendChild(r), n._blur = r, m(n.node, {
                filter: "url(#" + r.id + ")"
            })
        } else n._blur && (n._blur.parentNode.removeChild(n._blur), delete n._blur, delete n.attrs.blur), n.node.removeAttribute("filter")
    }, e._engine.circle = function (e, t, n, r) {
        var i = m("circle");
        e.canvas && e.canvas.appendChild(i);
        var s = new N(i, e);
        return s.attrs = {
            cx: t,
            cy: n,
            r: r,
            fill: "none",
            stroke: "#000"
        }, s.type = "circle", m(i, s.attrs), s
    }, e._engine.rect = function (e, t, n, r, i, s) {
        var o = m("rect");
        e.canvas && e.canvas.appendChild(o);
        var u = new N(o, e);
        return u.attrs = {
            x: t,
            y: n,
            width: r,
            height: i,
            r: s || 0,
            rx: s || 0,
            ry: s || 0,
            fill: "none",
            stroke: "#000"
        }, u.type = "rect", m(o, u.attrs), u
    }, e._engine.ellipse = function (e, t, n, r, i) {
        var s = m("ellipse");
        e.canvas && e.canvas.appendChild(s);
        var o = new N(s, e);
        return o.attrs = {
            cx: t,
            cy: n,
            rx: r,
            ry: i,
            fill: "none",
            stroke: "#000"
        }, o.type = "ellipse", m(s, o.attrs), o
    }, e._engine.image = function (e, t, n, r, i, s) {
        var o = m("image");
        m(o, {
            x: n,
            y: r,
            width: i,
            height: s,
            preserveAspectRatio: "none"
        }), o.setAttributeNS(p, "href", t), e.canvas && e.canvas.appendChild(o);
        var u = new N(o, e);
        return u.attrs = {
            x: n,
            y: r,
            width: i,
            height: s,
            src: t
        }, u.type = "image", u
    }, e._engine.text = function (t, n, r, i) {
        var s = m("text");
        t.canvas && t.canvas.appendChild(s);
        var o = new N(s, t);
        return o.attrs = {
            x: n,
            y: r,
            "text-anchor": "middle",
            text: i,
            font: e._availableAttrs.font,
            stroke: "none",
            fill: "#000"
        }, o.type = "text", S(o, o.attrs), o
    }, e._engine.setSize = function (e, t) {
        return this.width = e || this.width, this.height = t || this.height, this.canvas.setAttribute("width", this.width), this.canvas.setAttribute("height", this.height), this._viewBox && this.setViewBox.apply(this, this._viewBox), this
    }, e._engine.create = function () {
        var t = e._getContainer.apply(0, arguments),
            n = t && t.container,
            r = t.x,
            i = t.y,
            s = t.width,
            o = t.height;
        if (!n) throw new Error("SVG container not found.");
        var u = m("svg"),
            a = "overflow:hidden;",
            f;
        return r = r || 0, i = i || 0, s = s || 512, o = o || 342, m(u, {
            height: o,
            version: 1.1,
            width: s,
            xmlns: "http://www.w3.org/2000/svg"
        }), n == 1 ? (u.style.cssText = a + "position:absolute;left:" + r + "px;top:" + i + "px", e._g.doc.body.appendChild(u), f = 1) : (u.style.cssText = a + "position:relative", n.firstChild ? n.insertBefore(u, n.firstChild) : n.appendChild(u)), n = new e._Paper, n.width = s, n.height = o, n.canvas = u, n.clear(), n._left = n._top = 0, f && (n.renderfix = function () {}), n.renderfix(), n
    }, e._engine.setViewBox = function (e, t, n, r, i) {
        l("raphael.setViewBox", this, this._viewBox, [e, t, n, r, i]);
        var s = o(n / this.width, r / this.height),
            u = this.top,
            a = i ? "meet" : "xMinYMin",
            f, c;
        e == null ? (this._vbSize && (s = 1), delete this._vbSize, f = "0 0 " + this.width + h + this.height) : (this._vbSize = s, f = e + h + t + h + n + h + r), m(this.canvas, {
            viewBox: f,
            preserveAspectRatio: a
        });
        while (s && u) c = "stroke-width" in u.attrs ? u.attrs["stroke-width"] : 1, u.attr({
            "stroke-width": c
        }), u._.dirty = 1, u._.dirtyT = 1, u = u.prev;
        return this._viewBox = [e, t, n, r, !! i], this
    }, e.prototype.renderfix = function () {
        var e = this.canvas,
            t = e.style,
            n;
        try {
            n = e.getScreenCTM() || e.createSVGMatrix()
        } catch (r) {
            n = e.createSVGMatrix()
        }
        var i = -n.e % 1,
            s = -n.f % 1;
        if (i || s) i && (this._left = (this._left + i) % 1, t.left = this._left + "px"), s && (this._top = (this._top + s) % 1, t.top = this._top + "px")
    }, e.prototype.clear = function () {
        e.eve("raphael.clear", this);
        var t = this.canvas;
        while (t.firstChild) t.removeChild(t.firstChild);
        this.bottom = this.top = null, (this.desc = m("desc")).appendChild(e._g.doc.createTextNode("Created with Raphal " + e.version)), t.appendChild(this.desc), t.appendChild(this.defs = m("defs"))
    }, e.prototype.remove = function () {
        l("raphael.remove", this), this.canvas.parentNode && this.canvas.parentNode.removeChild(this.canvas);
        for (var t in this) this[t] = typeof this[t] == "function" ? e._removedFactory(t) : null
    };
    var k = e.st;
    for (var L in C) C[t](L) && !k[t](L) && (k[L] = function (e) {
        return function () {
            var t = arguments;
            return this.forEach(function (n) {
                n[e].apply(n, t)
            })
        }
    }(L))
}(window.Raphael), window.Raphael.vml && function (e) {
    var t = "hasOwnProperty",
        n = String,
        r = parseFloat,
        i = Math,
        s = i.round,
        o = i.max,
        u = i.min,
        a = i.abs,
        f = "fill",
        l = /[, ]+/,
        c = e.eve,
        h = " progid:DXImageTransform.Microsoft",
        p = " ",
        d = "",
        v = {
            M: "m",
            L: "l",
            C: "c",
            Z: "x",
            m: "t",
            l: "r",
            c: "v",
            z: "x"
        }, m = /([clmz]),?([^clmz]*)/gi,
        g = / progid:\S+Blur\([^\)]+\)/g,
        y = /-?[^,\s-]+/g,
        b = "position:absolute;left:0;top:0;width:1px;height:1px",
        w = 21600,
        E = {
            path: 1,
            rect: 1,
            image: 1
        }, S = {
            circle: 1,
            ellipse: 1
        }, x = function (t) {
            var r = /[ahqstv]/ig,
                i = e._pathToAbsolute;
            n(t).match(r) && (i = e._path2curve), r = /[clmz]/g;
            if (i == e._pathToAbsolute && !n(t).match(r)) {
                var o = n(t).replace(m, function (e, t, n) {
                    var r = [],
                        i = t.toLowerCase() == "m",
                        o = v[t];
                    return n.replace(y, function (e) {
                        i && r.length == 2 && (o += r + v[t == "m" ? "l" : "L"], r = []), r.push(s(e * w))
                    }), o + r
                });
                return o
            }
            var u = i(t),
                a, f;
            o = [];
            for (var l = 0, c = u.length; l < c; l++) {
                a = u[l], f = u[l][0].toLowerCase(), f == "z" && (f = "x");
                for (var h = 1, g = a.length; h < g; h++) f += s(a[h] * w) + (h != g - 1 ? "," : d);
                o.push(f)
            }
            return o.join(p)
        }, T = function (t, n, r) {
            var i = e.matrix();
            return i.rotate(-t, .5, .5), {
                dx: i.x(n, r),
                dy: i.y(n, r)
            }
        }, N = function (e, t, n, r, i, s) {
            var o = e._,
                u = e.matrix,
                l = o.fillpos,
                c = e.node,
                h = c.style,
                d = 1,
                v = "",
                m, g = w / t,
                y = w / n;
            h.visibility = "hidden";
            if ( !! t && !! n) {
                c.coordsize = a(g) + p + a(y), h.rotation = s * (t * n < 0 ? -1 : 1);
                if (s) {
                    var b = T(s, r, i);
                    r = b.dx, i = b.dy
                }
                t < 0 && (v += "x"), n < 0 && (v += " y") && (d = -1), h.flip = v, c.coordorigin = r * -g + p + i * -y;
                if (l || o.fillsize) {
                    var E = c.getElementsByTagName(f);
                    E = E && E[0], c.removeChild(E), l && (b = T(s, u.x(l[0], l[1]), u.y(l[0], l[1])), E.position = b.dx * d + p + b.dy * d), o.fillsize && (E.size = o.fillsize[0] * a(t) + p + o.fillsize[1] * a(n)), c.appendChild(E)
                }
                h.visibility = "visible"
            }
        };
    e.toString = function () {
        return "Your browser doesnt support SVG. Falling down to VML.\nYou are running Raphal " + this.version
    };
    var C = function (e, t, r) {
        var i = n(t).toLowerCase().split("-"),
            s = r ? "end" : "start",
            o = i.length,
            u = "classic",
            a = "medium",
            f = "medium";
        while (o--) switch (i[o]) {
        case "block":
        case "classic":
        case "oval":
        case "diamond":
        case "open":
        case "none":
            u = i[o];
            break;
        case "wide":
        case "narrow":
            f = i[o];
            break;
        case "long":
        case "short":
            a = i[o]
        }
        var l = e.node.getElementsByTagName("stroke")[0];
        l[s + "arrow"] = u, l[s + "arrowlength"] = a, l[s + "arrowwidth"] = f
    }, k = function (i, a) {
            i.attrs = i.attrs || {};
            var c = i.node,
                h = i.attrs,
                v = c.style,
                m, g = E[i.type] && (a.x != h.x || a.y != h.y || a.width != h.width || a.height != h.height || a.cx != h.cx || a.cy != h.cy || a.rx != h.rx || a.ry != h.ry || a.r != h.r),
                y = S[i.type] && (h.cx != a.cx || h.cy != a.cy || h.r != a.r || h.rx != a.rx || h.ry != a.ry),
                b = i;
            for (var T in a) a[t](T) && (h[T] = a[T]);
            g && (h.path = e._getPath[i.type](i), i._.dirty = 1), a.href && (c.href = a.href), a.title && (c.title = a.title), a.target && (c.target = a.target), a.cursor && (v.cursor = a.cursor), "blur" in a && i.blur(a.blur);
            if (a.path && i.type == "path" || g) c.path = x(~n(h.path).toLowerCase().indexOf("r") ? e._pathToAbsolute(h.path) : h.path), i.type == "image" && (i._.fillpos = [h.x, h.y], i._.fillsize = [h.width, h.height], N(i, 1, 1, 0, 0, 0));
            "transform" in a && i.transform(a.transform);
            if (y) {
                var k = +h.cx,
                    A = +h.cy,
                    O = +h.rx || +h.r || 0,
                    _ = +h.ry || +h.r || 0;
                c.path = e.format("ar{0},{1},{2},{3},{4},{1},{4},{1}x", s((k - O) * w), s((A - _) * w), s((k + O) * w), s((A + _) * w), s(k * w))
            }
            if ("clip-rect" in a) {
                var D = n(a["clip-rect"]).split(l);
                if (D.length == 4) {
                    D[2] = +D[2] + +D[0], D[3] = +D[3] + +D[1];
                    var P = c.clipRect || e._g.doc.createElement("div"),
                        H = P.style;
                    H.clip = e.format("rect({1}px {2}px {3}px {0}px)", D), c.clipRect || (H.position = "absolute", H.top = 0, H.left = 0, H.width = i.paper.width + "px", H.height = i.paper.height + "px", c.parentNode.insertBefore(P, c), P.appendChild(c), c.clipRect = P)
                }
                a["clip-rect"] || c.clipRect && (c.clipRect.style.clip = "auto")
            }
            if (i.textpath) {
                var B = i.textpath.style;
                a.font && (B.font = a.font), a["font-family"] && (B.fontFamily = '"' + a["font-family"].split(",")[0].replace(/^['"]+|['"]+$/g, d) + '"'), a["font-size"] && (B.fontSize = a["font-size"]), a["font-weight"] && (B.fontWeight = a["font-weight"]), a["font-style"] && (B.fontStyle = a["font-style"])
            }
            "arrow-start" in a && C(b, a["arrow-start"]), "arrow-end" in a && C(b, a["arrow-end"], 1);
            if (a.opacity != null || a["stroke-width"] != null || a.fill != null || a.src != null || a.stroke != null || a["stroke-width"] != null || a["stroke-opacity"] != null || a["fill-opacity"] != null || a["stroke-dasharray"] != null || a["stroke-miterlimit"] != null || a["stroke-linejoin"] != null || a["stroke-linecap"] != null) {
                var I = c.getElementsByTagName(f),
                    q = !1;
                I = I && I[0], !I && (q = I = M(f)), i.type == "image" && a.src && (I.src = a.src), a.fill && (I.on = !0);
                if (I.on == null || a.fill == "none" || a.fill === null) I.on = !1;
                if (I.on && a.fill) {
                    var R = n(a.fill).match(e._ISURL);
                    if (R) {
                        I.parentNode == c && c.removeChild(I), I.rotate = !0, I.src = R[1], I.type = "tile";
                        var U = i.getBBox(1);
                        I.position = U.x + p + U.y, i._.fillpos = [U.x, U.y], e._preload(R[1], function () {
                            i._.fillsize = [this.offsetWidth, this.offsetHeight]
                        })
                    } else I.color = e.getRGB(a.fill).hex, I.src = d, I.type = "solid", e.getRGB(a.fill).error && (b.type in {
                        circle: 1,
                        ellipse: 1
                    } || n(a.fill).charAt() != "r") && L(b, a.fill, I) && (h.fill = "none", h.gradient = a.fill, I.rotate = !1)
                }
                if ("fill-opacity" in a || "opacity" in a) {
                    var W = ((+h["fill-opacity"] + 1 || 2) - 1) * ((+h.opacity + 1 || 2) - 1) * ((+e.getRGB(a.fill).o + 1 || 2) - 1);
                    W = u(o(W, 0), 1), I.opacity = W, I.src && (I.color = "none")
                }
                c.appendChild(I);
                var X = c.getElementsByTagName("stroke") && c.getElementsByTagName("stroke")[0],
                    V = !1;
                !X && (V = X = M("stroke"));
                if (a.stroke && a.stroke != "none" || a["stroke-width"] || a["stroke-opacity"] != null || a["stroke-dasharray"] || a["stroke-miterlimit"] || a["stroke-linejoin"] || a["stroke-linecap"]) X.on = !0;
                (a.stroke == "none" || a.stroke === null || X.on == null || a.stroke == 0 || a["stroke-width"] == 0) && (X.on = !1);
                var $ = e.getRGB(a.stroke);
                X.on && a.stroke && (X.color = $.hex), W = ((+h["stroke-opacity"] + 1 || 2) - 1) * ((+h.opacity + 1 || 2) - 1) * ((+$.o + 1 || 2) - 1);
                var J = (r(a["stroke-width"]) || 1) * .75;
                W = u(o(W, 0), 1), a["stroke-width"] == null && (J = h["stroke-width"]), a["stroke-width"] && (X.weight = J), J && J < 1 && (W *= J) && (X.weight = 1), X.opacity = W, a["stroke-linejoin"] && (X.joinstyle = a["stroke-linejoin"] || "miter"), X.miterlimit = a["stroke-miterlimit"] || 8, a["stroke-linecap"] && (X.endcap = a["stroke-linecap"] == "butt" ? "flat" : a["stroke-linecap"] == "square" ? "square" : "round");
                if (a["stroke-dasharray"]) {
                    var K = {
                        "-": "shortdash",
                        ".": "shortdot",
                        "-.": "shortdashdot",
                        "-..": "shortdashdotdot",
                        ". ": "dot",
                        "- ": "dash",
                        "--": "longdash",
                        "- .": "dashdot",
                        "--.": "longdashdot",
                        "--..": "longdashdotdot"
                    };
                    X.dashstyle = K[t](a["stroke-dasharray"]) ? K[a["stroke-dasharray"]] : d
                }
                V && c.appendChild(X)
            }
            if (b.type == "text") {
                b.paper.canvas.style.display = d;
                var Q = b.paper.span,
                    G = 100,
                    Y = h.font && h.font.match(/\d+(?:\.\d*)?(?=px)/);
                v = Q.style, h.font && (v.font = h.font), h["font-family"] && (v.fontFamily = h["font-family"]), h["font-weight"] && (v.fontWeight = h["font-weight"]), h["font-style"] && (v.fontStyle = h["font-style"]), Y = r(h["font-size"] || Y && Y[0]) || 10, v.fontSize = Y * G + "px", b.textpath.string && (Q.innerHTML = n(b.textpath.string).replace(/</g, "&#60;").replace(/&/g, "&#38;").replace(/\n/g, "<br>"));
                var Z = Q.getBoundingClientRect();
                b.W = h.w = (Z.right - Z.left) / G, b.H = h.h = (Z.bottom - Z.top) / G, b.X = h.x, b.Y = h.y + b.H / 2, ("x" in a || "y" in a) && (b.path.v = e.format("m{0},{1}l{2},{1}", s(h.x * w), s(h.y * w), s(h.x * w) + 1));
                var et = ["x", "y", "text", "font", "font-family", "font-weight", "font-style", "font-size"];
                for (var tt = 0, nt = et.length; tt < nt; tt++)
                    if (et[tt] in a) {
                        b._.dirty = 1;
                        break
                    }
                switch (h["text-anchor"]) {
                case "start":
                    b.textpath.style["v-text-align"] = "left", b.bbx = b.W / 2;
                    break;
                case "end":
                    b.textpath.style["v-text-align"] = "right", b.bbx = -b.W / 2;
                    break;
                default:
                    b.textpath.style["v-text-align"] = "center", b.bbx = 0
                }
                b.textpath.style["v-text-kern"] = !0
            }
        }, L = function (t, s, o) {
            t.attrs = t.attrs || {};
            var u = t.attrs,
                a = Math.pow,
                f, l, c = "linear",
                h = ".5 .5";
            t.attrs.gradient = s, s = n(s).replace(e._radial_gradient, function (e, t, n) {
                return c = "radial", t && n && (t = r(t), n = r(n), a(t - .5, 2) + a(n - .5, 2) > .25 && (n = i.sqrt(.25 - a(t - .5, 2)) * ((n > .5) * 2 - 1) + .5), h = t + p + n), d
            }), s = s.split(/\s*\-\s*/);
            if (c == "linear") {
                var v = s.shift();
                v = -r(v);
                if (isNaN(v)) return null
            }
            var m = e._parseDots(s);
            if (!m) return null;
            t = t.shape || t.node;
            if (m.length) {
                t.removeChild(o), o.on = !0, o.method = "none", o.color = m[0].color, o.color2 = m[m.length - 1].color;
                var g = [];
                for (var y = 0, b = m.length; y < b; y++) m[y].offset && g.push(m[y].offset + p + m[y].color);
                o.colors = g.length ? g.join() : "0% " + o.color, c == "radial" ? (o.type = "gradientTitle", o.focus = "100%", o.focussize = "0 0", o.focusposition = h, o.angle = 0) : (o.type = "gradient", o.angle = (270 - v) % 360), t.appendChild(o)
            }
            return 1
        }, A = function (t, n) {
            this[0] = this.node = t, t.raphael = !0, this.id = e._oid++, t.raphaelid = this.id, this.X = 0, this.Y = 0, this.attrs = {}, this.paper = n, this.matrix = e.matrix(), this._ = {
                transform: [],
                sx: 1,
                sy: 1,
                dx: 0,
                dy: 0,
                deg: 0,
                dirty: 1,
                dirtyT: 1
            }, !n.bottom && (n.bottom = this), this.prev = n.top, n.top && (n.top.next = this), n.top = this, this.next = null
        }, O = e.el;
    A.prototype = O, O.constructor = A, O.transform = function (t) {
        if (t == null) return this._.transform;
        var r = this.paper._viewBoxShift,
            i = r ? "s" + [r.scale, r.scale] + "-1-1t" + [r.dx, r.dy] : d,
            s;
        r && (s = t = n(t).replace(/\.{3}|\u2026/g, this._.transform || d)), e._extractTransform(this, i + t);
        var o = this.matrix.clone(),
            u = this.skew,
            a = this.node,
            f, l = ~n(this.attrs.fill).indexOf("-"),
            c = !n(this.attrs.fill).indexOf("url(");
        o.translate(-0.5, -0.5);
        if (c || l || this.type == "image") {
            u.matrix = "1 0 0 1", u.offset = "0 0", f = o.split();
            if (l && f.noRotation || !f.isSimple) {
                a.style.filter = o.toFilter();
                var h = this.getBBox(),
                    v = this.getBBox(1),
                    m = h.x - v.x,
                    g = h.y - v.y;
                a.coordorigin = m * -w + p + g * -w, N(this, 1, 1, m, g, 0)
            } else a.style.filter = d, N(this, f.scalex, f.scaley, f.dx, f.dy, f.rotate)
        } else a.style.filter = d, u.matrix = n(o), u.offset = o.offset();
        return s && (this._.transform = s), this
    }, O.rotate = function (e, t, i) {
        if (this.removed) return this;
        if (e != null) {
            e = n(e).split(l), e.length - 1 && (t = r(e[1]), i = r(e[2])), e = r(e[0]), i == null && (t = i);
            if (t == null || i == null) {
                var s = this.getBBox(1);
                t = s.x + s.width / 2, i = s.y + s.height / 2
            }
            return this._.dirtyT = 1, this.transform(this._.transform.concat([
                ["r", e, t, i]
            ])), this
        }
    }, O.translate = function (e, t) {
        return this.removed ? this : (e = n(e).split(l), e.length - 1 && (t = r(e[1])), e = r(e[0]) || 0, t = +t || 0, this._.bbox && (this._.bbox.x += e, this._.bbox.y += t), this.transform(this._.transform.concat([
            ["t", e, t]
        ])), this)
    }, O.scale = function (e, t, i, s) {
        if (this.removed) return this;
        e = n(e).split(l), e.length - 1 && (t = r(e[1]), i = r(e[2]), s = r(e[3]), isNaN(i) && (i = null), isNaN(s) && (s = null)), e = r(e[0]), t == null && (t = e), s == null && (i = s);
        if (i == null || s == null) var o = this.getBBox(1);
        return i = i == null ? o.x + o.width / 2 : i, s = s == null ? o.y + o.height / 2 : s, this.transform(this._.transform.concat([
            ["s", e, t, i, s]
        ])), this._.dirtyT = 1, this
    }, O.hide = function () {
        return !this.removed && (this.node.style.display = "none"), this
    }, O.show = function () {
        return !this.removed && (this.node.style.display = d), this
    }, O._getBBox = function () {
        return this.removed ? {} : {
            x: this.X + (this.bbx || 0) - this.W / 2,
            y: this.Y - this.H,
            width: this.W,
            height: this.H
        }
    }, O.remove = function () {
        if (!this.removed && !! this.node.parentNode) {
            this.paper.__set__ && this.paper.__set__.exclude(this), e.eve.unbind("raphael.*.*." + this.id), e._tear(this, this.paper), this.node.parentNode.removeChild(this.node), this.shape && this.shape.parentNode.removeChild(this.shape);
            for (var t in this) this[t] = typeof this[t] == "function" ? e._removedFactory(t) : null;
            this.removed = !0
        }
    }, O.attr = function (n, r) {
        if (this.removed) return this;
        if (n == null) {
            var i = {};
            for (var s in this.attrs) this.attrs[t](s) && (i[s] = this.attrs[s]);
            return i.gradient && i.fill == "none" && (i.fill = i.gradient) && delete i.gradient, i.transform = this._.transform, i
        }
        if (r == null && e.is(n, "string")) {
            if (n == f && this.attrs.fill == "none" && this.attrs.gradient) return this.attrs.gradient;
            var o = n.split(l),
                u = {};
            for (var a = 0, h = o.length; a < h; a++) n = o[a], n in this.attrs ? u[n] = this.attrs[n] : e.is(this.paper.customAttributes[n], "function") ? u[n] = this.paper.customAttributes[n].def : u[n] = e._availableAttrs[n];
            return h - 1 ? u : u[o[0]]
        }
        if (this.attrs && r == null && e.is(n, "array")) {
            u = {};
            for (a = 0, h = n.length; a < h; a++) u[n[a]] = this.attr(n[a]);
            return u
        }
        var p;
        r != null && (p = {}, p[n] = r), r == null && e.is(n, "object") && (p = n);
        for (var d in p) c("raphael.attr." + d + "." + this.id, this, p[d]);
        if (p) {
            for (d in this.paper.customAttributes)
                if (this.paper.customAttributes[t](d) && p[t](d) && e.is(this.paper.customAttributes[d], "function")) {
                    var v = this.paper.customAttributes[d].apply(this, [].concat(p[d]));
                    this.attrs[d] = p[d];
                    for (var m in v) v[t](m) && (p[m] = v[m])
                }
            p.text && this.type == "text" && (this.textpath.string = p.text), k(this, p)
        }
        return this
    }, O.toFront = function () {
        return !this.removed && this.node.parentNode.appendChild(this.node), this.paper && this.paper.top != this && e._tofront(this, this.paper), this
    }, O.toBack = function () {
        return this.removed ? this : (this.node.parentNode.firstChild != this.node && (this.node.parentNode.insertBefore(this.node, this.node.parentNode.firstChild), e._toback(this, this.paper)), this)
    }, O.insertAfter = function (t) {
        return this.removed ? this : (t.constructor == e.st.constructor && (t = t[t.length - 1]), t.node.nextSibling ? t.node.parentNode.insertBefore(this.node, t.node.nextSibling) : t.node.parentNode.appendChild(this.node), e._insertafter(this, t, this.paper), this)
    }, O.insertBefore = function (t) {
        return this.removed ? this : (t.constructor == e.st.constructor && (t = t[0]), t.node.parentNode.insertBefore(this.node, t.node), e._insertbefore(this, t, this.paper), this)
    }, O.blur = function (t) {
        var n = this.node.runtimeStyle,
            r = n.filter;
        r = r.replace(g, d), +t !== 0 ? (this.attrs.blur = t, n.filter = r + p + h + ".Blur(pixelradius=" + (+t || 1.5) + ")", n.margin = e.format("-{0}px 0 0 -{0}px", s(+t || 1.5))) : (n.filter = r, n.margin = 0, delete this.attrs.blur)
    }, e._engine.path = function (e, t) {
        var n = M("shape");
        n.style.cssText = b, n.coordsize = w + p + w, n.coordorigin = t.coordorigin;
        var r = new A(n, t),
            i = {
                fill: "none",
                stroke: "#000"
            };
        e && (i.path = e), r.type = "path", r.path = [], r.Path = d, k(r, i), t.canvas.appendChild(n);
        var s = M("skew");
        return s.on = !0, n.appendChild(s), r.skew = s, r.transform(d), r
    }, e._engine.rect = function (t, n, r, i, s, o) {
        var u = e._rectPath(n, r, i, s, o),
            a = t.path(u),
            f = a.attrs;
        return a.X = f.x = n, a.Y = f.y = r, a.W = f.width = i, a.H = f.height = s, f.r = o, f.path = u, a.type = "rect", a
    }, e._engine.ellipse = function (e, t, n, r, i) {
        var s = e.path(),
            o = s.attrs;
        return s.X = t - r, s.Y = n - i, s.W = r * 2, s.H = i * 2, s.type = "ellipse", k(s, {
            cx: t,
            cy: n,
            rx: r,
            ry: i
        }), s
    }, e._engine.circle = function (e, t, n, r) {
        var i = e.path(),
            s = i.attrs;
        return i.X = t - r, i.Y = n - r, i.W = i.H = r * 2, i.type = "circle", k(i, {
            cx: t,
            cy: n,
            r: r
        }), i
    }, e._engine.image = function (t, n, r, i, s, o) {
        var u = e._rectPath(r, i, s, o),
            a = t.path(u).attr({
                stroke: "none"
            }),
            l = a.attrs,
            c = a.node,
            h = c.getElementsByTagName(f)[0];
        return l.src = n, a.X = l.x = r, a.Y = l.y = i, a.W = l.width = s, a.H = l.height = o, l.path = u, a.type = "image", h.parentNode == c && c.removeChild(h), h.rotate = !0, h.src = n, h.type = "tile", a._.fillpos = [r, i], a._.fillsize = [s, o], c.appendChild(h), N(a, 1, 1, 0, 0, 0), a
    }, e._engine.text = function (t, r, i, o) {
        var u = M("shape"),
            a = M("path"),
            f = M("textpath");
        r = r || 0, i = i || 0, o = o || "", a.v = e.format("m{0},{1}l{2},{1}", s(r * w), s(i * w), s(r * w) + 1), a.textpathok = !0, f.string = n(o), f.on = !0, u.style.cssText = b, u.coordsize = w + p + w, u.coordorigin = "0 0";
        var l = new A(u, t),
            c = {
                fill: "#000",
                stroke: "none",
                font: e._availableAttrs.font,
                text: o
            };
        l.shape = u, l.path = a, l.textpath = f, l.type = "text", l.attrs.text = n(o), l.attrs.x = r, l.attrs.y = i, l.attrs.w = 1, l.attrs.h = 1, k(l, c), u.appendChild(f), u.appendChild(a), t.canvas.appendChild(u);
        var h = M("skew");
        return h.on = !0, u.appendChild(h), l.skew = h, l.transform(d), l
    }, e._engine.setSize = function (t, n) {
        var r = this.canvas.style;
        return this.width = t, this.height = n, t == +t && (t += "px"), n == +n && (n += "px"), r.width = t, r.height = n, r.clip = "rect(0 " + t + " " + n + " 0)", this._viewBox && e._engine.setViewBox.apply(this, this._viewBox), this
    }, e._engine.setViewBox = function (t, n, r, i, s) {
        e.eve("raphael.setViewBox", this, this._viewBox, [t, n, r, i, s]);
        var u = this.width,
            a = this.height,
            f = 1 / o(r / u, i / a),
            l, c;
        return s && (l = a / i, c = u / r, r * l < u && (t -= (u - r * l) / 2 / l), i * c < a && (n -= (a - i * c) / 2 / c)), this._viewBox = [t, n, r, i, !! s], this._viewBoxShift = {
            dx: -t,
            dy: -n,
            scale: f
        }, this.forEach(function (e) {
            e.transform("...")
        }), this
    };
    var M;
    e._engine.initWin = function (e) {
        var t = e.document;
        t.createStyleSheet().addRule(".rvml", "behavior:url(#default#VML)");
        try {
            !t.namespaces.rvml && t.namespaces.add("rvml", "urn:schemas-microsoft-com:vml"), M = function (e) {
                return t.createElement("<rvml:" + e + ' class="rvml">')
            }
        } catch (n) {
            M = function (e) {
                return t.createElement("<" + e + ' xmlns="urn:schemas-microsoft.com:vml" class="rvml">')
            }
        }
    }, e._engine.initWin(e._g.win), e._engine.create = function () {
        var t = e._getContainer.apply(0, arguments),
            n = t.container,
            r = t.height,
            i, s = t.width,
            o = t.x,
            u = t.y;
        if (!n) throw new Error("VML container not found.");
        var a = new e._Paper,
            f = a.canvas = e._g.doc.createElement("div"),
            l = f.style;
        return o = o || 0, u = u || 0, s = s || 512, r = r || 342, a.width = s, a.height = r, s == +s && (s += "px"), r == +r && (r += "px"), a.coordsize = w * 1e3 + p + w * 1e3, a.coordorigin = "0 0", a.span = e._g.doc.createElement("span"), a.span.style.cssText = "position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;", f.appendChild(a.span), l.cssText = e.format("top:0;left:0;width:{0};height:{1};display:inline-block;position:relative;clip:rect(0 {0} {1} 0);overflow:hidden", s, r), n == 1 ? (e._g.doc.body.appendChild(f), l.left = o + "px", l.top = u + "px", l.position = "absolute") : n.firstChild ? n.insertBefore(f, n.firstChild) : n.appendChild(f), a.renderfix = function () {}, a
    }, e.prototype.clear = function () {
        e.eve("raphael.clear", this), this.canvas.innerHTML = d, this.span = e._g.doc.createElement("span"), this.span.style.cssText = "position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;display:inline;", this.canvas.appendChild(this.span), this.bottom = this.top = null
    }, e.prototype.remove = function () {
        e.eve("raphael.remove", this), this.canvas.parentNode.removeChild(this.canvas);
        for (var t in this) this[t] = typeof this[t] == "function" ? e._removedFactory(t) : null;
        return !0
    };
    var _ = e.st;
    for (var D in O) O[t](D) && !_[t](D) && (_[D] = function (e) {
        return function () {
            var t = arguments;
            return this.forEach(function (n) {
                n[e].apply(n, t)
            })
        }
    }(D))
}(window.Raphael), JustGage = function (e) {
    if (!e.id) return alert("Missing id parameter for gauge!"), !1;
    if (!document.getElementById(e.id)) return alert('No element with id: "' + e.id + '" found!'), !1;
    this.config = {
        id: e.id,
        title: e.title ? e.title : "Title",
        titleFontColor: e.titleFontColor ? e.titleFontColor : "#999999",
        value: e.value ? e.value : 0,
        valueFontColor: e.valueFontColor ? e.valueFontColor : "#010101",
        min: e.min ? e.min : 0,
        max: e.max ? e.max : 100,
        showMinMax: e.showMinMax != null ? e.showMinMax : !0,
        gaugeWidthScale: e.gaugeWidthScale ? e.gaugeWidthScale : 1,
        gaugeColor: e.gaugeColor ? e.gaugeColor : "#edebeb",
        label: e.label ? e.label : "",
        showInnerShadow: e.showInnerShadow != null ? e.showInnerShadow : !0,
        shadowOpacity: e.shadowOpacity ? e.shadowOpacity : .2,
        shadowSize: e.shadowSize ? e.shadowSize : 5,
        shadowVerticalOffset: e.shadowVerticalOffset ? e.shadowVerticalOffset : 3,
        levelColors: e.levelColors ? e.levelColors : percentColors,
        levelColorsGradient: e.levelColorsGradient != null ? e.levelColorsGradient : !0,
        labelFontColor: e.labelFontColor ? e.labelFontColor : "#b3b3b3",
        startAnimationTime: e.startAnimationTime ? e.startAnimationTime : 700,
        startAnimationType: e.startAnimationType ? e.startAnimationType : ">",
        refreshAnimationTime: e.refreshAnimationTime ? e.refreshAnimationTime : 700,
        refreshAnimationType: e.refreshAnimationType ? e.refreshAnimationType : ">"
    }, e.value > this.config.max && (this.config.value = this.config.max), e.value < this.config.min && (this.config.value = this.config.min), this.originalValue = e.value, this.canvas = Raphael(this.config.id, "100%", "100%");
    var t = getStyle(document.getElementById(this.config.id), "width").slice(0, -2) * 1,
        n = getStyle(document.getElementById(this.config.id), "height").slice(0, -2) * 1,
        r, i;
    t / n > 1.25 ? (r = 1.25 * n, i = n) : (r = t, i = t / 1.25);
    var s = (t - r) / 2,
        o = (n - i) / 2,
        u = i / 8 > 10 ? i / 10 : 10,
        a = s + r / 2,
        f = o + i / 6.5,
        l = i / 6.4 > 16 ? i / 6.4 : 16,
        c = s + r / 2,
        h = o + i / 1.4,
        p = i / 16 > 10 ? i / 16 : 10,
        d = s + r / 2,
        v = h + l / 2 + 6,
        m = i / 16 > 10 ? i / 16 : 10,
        g = s + r / 10 + r / 6.666666666666667 * this.config.gaugeWidthScale / 2,
        y = o + i / 1.126760563380282,
        b = i / 16 > 10 ? i / 16 : 10,
        w = s + r - r / 10 - r / 6.666666666666667 * this.config.gaugeWidthScale / 2,
        E = o + i / 1.126760563380282;
    this.params = {
        canvasW: t,
        canvasH: n,
        widgetW: r,
        widgetH: i,
        dx: s,
        dy: o,
        titleFontSize: u,
        titleX: a,
        titleY: f,
        valueFontSize: l,
        valueX: c,
        valueY: h,
        labelFontSize: p,
        labelX: d,
        labelY: v,
        minFontSize: m,
        minX: g,
        minY: y,
        maxFontSize: b,
        maxX: w,
        maxY: E
    }, this.canvas.customAttributes.pki = function (e, t, n, r, i, s, o, u) {
        var a = (1 - (e - t) / (n - t)) * Math.PI,
            f = r / 2 - r / 10,
            l = f - r / 6.666666666666667 * u,
            c = r / 2 + s,
            h = i / 1.25 + o,
            p = r / 2 + s + f * Math.cos(a),
            d = i - (i - h) + o - f * Math.sin(a),
            v = r / 2 + s + l * Math.cos(a),
            m = i - (i - h) + o - l * Math.sin(a),
            g;
        return g += "M" + (c - l) + "," + h + " ", g += "L" + (c - f) + "," + h + " ", g += "A" + f + "," + f + " 0 0,1 " + p + "," + d + " ", g += "L" + v + "," + m + " ", g += "A" + l + "," + l + " 0 0,0 " + (c - l) + "," + h + " ", g += "z ", {
            path: g
        }
    }, this.gauge = this.canvas.path().attr({
        stroke: "none",
        fill: this.config.gaugeColor,
        pki: [this.config.max, this.config.min, this.config.max, this.params.widgetW, this.params.widgetH, this.params.dx, this.params.dy, this.config.gaugeWidthScale]
    }), this.gauge.id = this.config.id + "-gauge", this.level = this.canvas.path().attr({
        stroke: "none",
        fill: getColorForPercentage((this.config.value - this.config.min) / (this.config.max - this.config.min), this.config.levelColors, this.config.levelColorsGradient),
        pki: [this.config.min, this.config.min, this.config.max, this.params.widgetW, this.params.widgetH, this.params.dx, this.params.dy, this.config.gaugeWidthScale]
    }), this.level.id = this.config.id + "-level", this.txtTitle = this.canvas.text(this.params.titleX, this.params.titleY, this.config.title), this.txtTitle.attr({
        "font-size": this.params.titleFontSize,
        "font-weight": "bold",
        "font-family": "Arial",
        fill: this.config.titleFontColor,
        "fill-opacity": "1"
    }), this.txtTitle.id = this.config.id + "-txttitle", this.txtValue = this.canvas.text(this.params.valueX, this.params.valueY, this.originalValue), this.txtValue.attr({
        "font-size": this.params.valueFontSize,
        "font-weight": "bold",
        "font-family": "Arial",
        fill: this.config.valueFontColor,
        "fill-opacity": "0"
    }), this.txtValue.id = this.config.id + "-txtvalue", this.txtLabel = this.canvas.text(this.params.labelX, this.params.labelY, this.config.label), this.txtLabel.attr({
        "font-size": this.params.labelFontSize,
        "font-weight": "normal",
        "font-family": "Arial",
        fill: this.config.labelFontColor,
        "fill-opacity": "0"
    }), this.txtLabel.id = this.config.id + "-txtlabel", this.txtMin = this.canvas.text(this.params.minX, this.params.minY, this.config.min), this.txtMin.attr({
        "font-size": this.params.minFontSize,
        "font-weight": "normal",
        "font-family": "Arial",
        fill: this.config.labelFontColor,
        "fill-opacity": this.config.showMinMax == 1 ? "1" : "0"
    }), this.txtMin.id = this.config.id + "-txtmin", this.txtMax = this.canvas.text(this.params.maxX, this.params.maxY, this.config.max), this.txtMax.attr({
        "font-size": this.params.maxFontSize,
        "font-weight": "normal",
        "font-family": "Arial",
        fill: this.config.labelFontColor,
        "fill-opacity": this.config.showMinMax == 1 ? "1" : "0"
    }), this.txtMax.id = this.config.id + "-txtmax";
    var S = this.canvas.canvas.childNodes[1],
        x = "http://www.w3.org/2000/svg";
    ie < 9 ? onCreateElementNsReady(function () {
        this.generateShadow()
    }) : this.generateShadow(x, S), this.level.animate({
        pki: [this.config.value, this.config.min, this.config.max, this.params.widgetW, this.params.widgetH, this.params.dx, this.params.dy, this.config.gaugeWidthScale]
    }, this.config.startAnimationTime, this.config.startAnimationType), this.txtValue.animate({
        "fill-opacity": "1"
    }, this.config.startAnimationTime, this.config.startAnimationType), this.txtLabel.animate({
        "fill-opacity": "1"
    }, this.config.startAnimationTime, this.config.startAnimationType)
}, JustGage.prototype.refresh = function (e) {
    originalVal = e, e > this.config.max && (e = this.config.max), e < this.config.min && (e = this.config.min);
    var t = getColorForPercentage((e - this.config.min) / (this.config.max - this.config.min), this.config.levelColors, this.config.levelColorsGradient);
    this.canvas.getById(this.config.id + "-txtvalue").attr({
        text: originalVal
    }), this.canvas.getById(this.config.id + "-level").animate({
        pki: [e, this.config.min, this.config.max, this.params.widgetW, this.params.widgetH, this.params.dx, this.params.dy, this.config.gaugeWidthScale],
        fill: t
    }, this.config.refreshAnimationTime, this.config.refreshAnimationType)
};
var percentColors = ["#a9d70b", "#f9c802", "#ff0000"];
JustGage.prototype.generateShadow = function (e, t) {
    var n = document.createElementNS(e, "filter");
    n.setAttribute("id", this.config.id + "-inner-shadow"), t.appendChild(n);
    var r = document.createElementNS(e, "feOffset");
    r.setAttribute("dx", 0), r.setAttribute("dy", this.config.shadowVerticalOffset), n.appendChild(r);
    var i = document.createElementNS(e, "feGaussianBlur");
    i.setAttribute("result", "offset-blur"), i.setAttribute("stdDeviation", this.config.shadowSize), n.appendChild(i);
    var s = document.createElementNS(e, "feComposite");
    s.setAttribute("operator", "out"), s.setAttribute("in", "SourceGraphic"), s.setAttribute("in2", "offset-blur"), s.setAttribute("result", "inverse"), n.appendChild(s);
    var o = document.createElementNS(e, "feFlood");
    o.setAttribute("flood-color", "black"), o.setAttribute("flood-opacity", this.config.shadowOpacity), o.setAttribute("result", "color"), n.appendChild(o);
    var u = document.createElementNS(e, "feComposite");
    u.setAttribute("operator", "in"), u.setAttribute("in", "color"), u.setAttribute("in2", "inverse"), u.setAttribute("result", "shadow"), n.appendChild(u);
    var a = document.createElementNS(e, "feComposite");
    a.setAttribute("operator", "over"), a.setAttribute("in", "shadow"), a.setAttribute("in2", "SourceGraphic"), n.appendChild(a), this.config.showInnerShadow == 1 && (this.canvas.canvas.childNodes[2].setAttribute("filter", "url(#" + this.config.id + "-inner-shadow)"), this.canvas.canvas.childNodes[3].setAttribute("filter", "url(#" + this.config.id + "-inner-shadow)"))
};
var getColorForPercentage = function (e, t, n) {
    var r = t.length;
    if (r === 1) return t[0];
    var i = n ? 1 / (r - 1) : 1 / r,
        s = new Array;
    for (var o = 0; o < t.length; o++) {
        var u = n ? i * o : i * (o + 1),
            a = parseInt(cutHex(t[o]).substring(0, 2), 16),
            f = parseInt(cutHex(t[o]).substring(2, 4), 16),
            l = parseInt(cutHex(t[o]).substring(4, 6), 16);
        s[o] = {
            pct: u,
            color: {
                r: a,
                g: f,
                b: l
            }
        }
    }
    if (e == 0) return "rgb(" + [s[0].color.r, s[0].color.g, s[0].color.b].join(",") + ")";
    for (var o = 0; o < s.length; o++)
        if (e <= s[o].pct) {
            if (n == 1) {
                var c = s[o - 1],
                    h = s[o],
                    p = h.pct - c.pct,
                    d = (e - c.pct) / p,
                    v = 1 - d,
                    m = d,
                    g = {
                        r: Math.floor(c.color.r * v + h.color.r * m),
                        g: Math.floor(c.color.g * v + h.color.g * m),
                        b: Math.floor(c.color.b * v + h.color.b * m)
                    };
                return "rgb(" + [g.r, g.g, g.b].join(",") + ")"
            }
            return "rgb(" + [s[o].color.r, s[o].color.g, s[o].color.b].join(",") + ")"
        }
}, ie = function () {
        var e, t = 3,
            n = document.createElement("div"),
            r = n.getElementsByTagName("i");
        while (n.innerHTML = "<!--[if gt IE " + ++t + "]><i></i><![endif]-->", r[0]);
        return t > 4 ? t : e
    }();
(function () {
    (function (e) {
        return e.easyPieChart = function (t, n) {
            var r, i, s, o, u, a, f, l = this;
            return this.el = t, this.$el = e(t), this.$el.data("easyPieChart", this), this.init = function () {
                var t, r;
                return l.options = e.extend({}, e.easyPieChart.defaultOptions, n), t = parseInt(l.$el.data("percent"), 10), l.percentage = 0, l.canvas = e("<canvas width='" + l.options.size + "' height='" + l.options.size + "'></canvas>").get(0), l.$el.append(l.canvas), typeof G_vmlCanvasManager != "undefined" && G_vmlCanvasManager !== null && G_vmlCanvasManager.initElement(l.canvas), l.ctx = l.canvas.getContext("2d"), window.devicePixelRatio > 1 && (r = window.devicePixelRatio, e(l.canvas).css({
                    width: l.options.size,
                    height: l.options.size
                }), l.canvas.width *= r, l.canvas.height *= r, l.ctx.scale(r, r)), l.ctx.translate(l.options.size / 2, l.options.size / 2), l.$el.addClass("easyPieChart"), l.$el.css({
                    width: l.options.size,
                    height: l.options.size,
                    lineHeight: "" + l.options.size + "px"
                }), l.update(t), l
            }, this.update = function (e) {
                return l.options.animate === !1 ? s(e) : i(l.percentage, e)
            }, a = function () {
                var e, t, n;
                l.ctx.fillStyle = l.options.scaleColor, l.ctx.lineWidth = 1, n = [];
                for (e = t = 0; t <= 24; e = ++t) n.push(r(e));
                return n
            }, r = function (e) {
                var t;
                return t = e % 6 === 0 ? 0 : l.options.size * .017, l.ctx.save(), l.ctx.rotate(e * Math.PI / 12), l.ctx.fillRect(l.options.size / 2 - t, 0, -l.options.size * .05 + t, 1), l.ctx.restore()
            }, f = function () {
                var e;
                return e = l.options.size / 2 - l.options.lineWidth / 2, l.options.scaleColor !== !1 && (e -= l.options.size * .08), l.ctx.beginPath(), l.ctx.arc(0, 0, e, 0, Math.PI * 2, !0), l.ctx.closePath(), l.ctx.strokeStyle = l.options.trackColor, l.ctx.lineWidth = l.options.lineWidth, l.ctx.stroke()
            }, u = function () {
                l.options.scaleColor !== !1 && a();
                if (l.options.trackColor !== !1) return f()
            }, s = function (t) {
                var n;
                return u(), l.ctx.strokeStyle = e.isFunction(l.options.barColor) ? l.options.barColor(t) : l.options.barColor, l.ctx.lineCap = l.options.lineCap, l.ctx.lineWidth = l.options.lineWidth, n = l.options.size / 2 - l.options.lineWidth / 2, l.options.scaleColor !== !1 && (n -= l.options.size * .08), l.ctx.save(), l.ctx.rotate(-Math.PI / 2), l.ctx.beginPath(), l.ctx.arc(0, 0, n, 0, Math.PI * 2 * t / 100, !1), l.ctx.stroke(), l.ctx.restore()
            }, i = function (e, t) {
                var n, r, i;
                return r = 30, i = r * l.options.animate / 1e3, n = 0, l.options.onStart.call(l), l.percentage = t, l.animation && (clearInterval(l.animation), l.animation = !1), l.animation = setInterval(function () {
                    l.ctx.clearRect(-l.options.size / 2, -l.options.size / 2, l.options.size, l.options.size), u.call(l), s.call(l, [o(n, e, t - e, i)]), n++;
                    if (n / i > 1) return clearInterval(l.animation), l.animation = !1, l.options.onStop.call(l)
                }, 1e3 / r)
            }, o = function (e, t, n, r) {
                var i, s;
                return i = function (e) {
                    return Math.pow(e, 2)
                }, s = function (e) {
                    return e < 1 ? i(e) : 2 - i(e / 2 * -2 + 2)
                }, e /= r / 2, n / 2 * s(e) + t
            }, this.init()
        }, e.easyPieChart.defaultOptions = {
            barColor: "#ef1e25",
            trackColor: "#f2f2f2",
            scaleColor: "#dfe0e0",
            lineCap: "round",
            size: 110,
            lineWidth: 3,
            animate: !1,
            onStart: e.noop,
            onStop: e.noop
        }, e.fn.easyPieChart = function (t) {
            return e.each(this, function (n, r) {
                var i;
                i = e(r);
                if (!i.data("easyPieChart")) return i.data("easyPieChart", new e.easyPieChart(r, t))
            })
        }, void 0
    })(jQuery)
}).call(this),
function () {
    var e = $('<div id="galleryOverlay">'),
        t = $('<div id="gallerySlider">'),
        n = $('<a id="prevArrow"><i class="icon-angle-left icon-4x"></i></a>'),
        r = $('<a id="nextArrow"><i class="icon-angle-right icon-4x"></i></a>'),
        i = !1;
    $.fn.touchTouch = function () {
        function a(t) {
            if (i) return !1;
            e.show(), setTimeout(function () {
                e.addClass("visible")
            }, 100), l(t), i = !0
        }

        function f() {
            if (!i) return !1;
            e.hide().removeClass("visible"), i = !1
        }

        function l(e) {
            t.css("left", -e * 100 + "%")
        }

        function c(e) {
            setTimeout(function () {
                h(e)
            }, 1e3)
        }

        function h(e) {
            if (e < 0 || e >= u.length) return !1;
            p(u.eq(e).attr("href"), function () {
                s.eq(e).html(this)
            })
        }

        function p(e, t) {
            var n = $("<img>").on("load", function () {
                t.call(n)
            });
            n.attr("src", e)
        }

        function d() {
            o + 1 < u.length ? (o++, l(o), c(o + 1)) : (t.addClass("rightSpring"), setTimeout(function () {
                t.removeClass("rightSpring")
            }, 500))
        }

        function v() {
            o > 0 ? (o--, l(o), c(o - 1)) : (t.addClass("leftSpring"), setTimeout(function () {
                t.removeClass("leftSpring")
            }, 500))
        }
        var s = $([]),
            o = 0,
            u = this;
        e.hide().appendTo("body"), t.appendTo(e), u.each(function () {
            s = s.add($('<div class="placeholder">'))
        }), t.append(s).on("click", function (e) {
            $(e.target).is("img") || f()
        }), $("body").on("touchstart", "#gallerySlider img", function (e) {
            var n = e.originalEvent,
                r = n.changedTouches[0].pageX;
            return t.on("touchmove", function (e) {
                e.preventDefault(), n = e.originalEvent.touches[0] || e.originalEvent.changedTouches[0], n.pageX - r > 10 ? (t.off("touchmove"), v()) : n.pageX - r < -10 && (t.off("touchmove"), d())
            }), !1
        }).on("touchend", function () {
            t.off("touchmove")
        }), u.on("click", function (e) {
            e.preventDefault(), o = u.index(this), a(o), h(o), c(o + 1), c(o - 1)
        }), "ontouchstart" in window || (e.append(n).append(r), n.click(function (e) {
            e.preventDefault(), v()
        }), r.click(function (e) {
            e.preventDefault(), d()
        })), $(window).bind("keydown", function (e) {
            e.keyCode == 37 ? v() : e.keyCode == 39 && d()
        })
    }
}(jQuery),
function (X, l, n) {
    var L = function (h) {
        var j = function (e) {
            function o(e, t) {
                var r = j.defaults.columns,
                    i = e.aoColumns.length,
                    r = h.extend({}, j.models.oColumn, r, {
                        sSortingClass: e.oClasses.sSortable,
                        sSortingClassJUI: e.oClasses.sSortJUI,
                        nTh: t ? t : l.createElement("th"),
                        sTitle: r.sTitle ? r.sTitle : t ? t.innerHTML : "",
                        aDataSort: r.aDataSort ? r.aDataSort : [i],
                        mData: r.mData ? r.oDefaults : i
                    });
                e.aoColumns.push(r);
                if (e.aoPreSearchCols[i] === n || null === e.aoPreSearchCols[i]) e.aoPreSearchCols[i] = h.extend({}, j.models.oSearch);
                else if (r = e.aoPreSearchCols[i], r.bRegex === n && (r.bRegex = !0), r.bSmart === n && (r.bSmart = !0), r.bCaseInsensitive === n) r.bCaseInsensitive = !0;
                m(e, i, null)
            }

            function m(e, t, r) {
                var i = e.aoColumns[t];
                r !== n && null !== r && (r.mDataProp && !r.mData && (r.mData = r.mDataProp), r.sType !== n && (i.sType = r.sType, i._bAutoType = !1), h.extend(i, r), p(i, r, "sWidth", "sWidthOrig"), r.iDataSort !== n && (i.aDataSort = [r.iDataSort]), p(i, r, "aDataSort"));
                var s = i.mRender ? Q(i.mRender) : null,
                    o = Q(i.mData);
                i.fnGetData = function (e, t) {
                    var n = o(e, t);
                    return i.mRender && t && "" !== t ? s(n, t, e) : n
                }, i.fnSetData = L(i.mData), e.oFeatures.bSort || (i.bSortable = !1), !i.bSortable || -1 == h.inArray("asc", i.asSorting) && -1 == h.inArray("desc", i.asSorting) ? (i.sSortingClass = e.oClasses.sSortableNone, i.sSortingClassJUI = "") : -1 == h.inArray("asc", i.asSorting) && -1 == h.inArray("desc", i.asSorting) ? (i.sSortingClass = e.oClasses.sSortable, i.sSortingClassJUI = e.oClasses.sSortJUI) : -1 != h.inArray("asc", i.asSorting) && -1 == h.inArray("desc", i.asSorting) ? (i.sSortingClass = e.oClasses.sSortableAsc, i.sSortingClassJUI = e.oClasses.sSortJUIAscAllowed) : -1 == h.inArray("asc", i.asSorting) && -1 != h.inArray("desc", i.asSorting) && (i.sSortingClass = e.oClasses.sSortableDesc, i.sSortingClassJUI = e.oClasses.sSortJUIDescAllowed)
            }

            function k(e) {
                if (!1 === e.oFeatures.bAutoWidth) return !1;
                da(e);
                for (var t = 0, n = e.aoColumns.length; t < n; t++) e.aoColumns[t].nTh.style.width = e.aoColumns[t].sWidth
            }

            function G(e, t) {
                var n = r(e, "bVisible");
                return "number" == typeof n[t] ? n[t] : null
            }

            function R(e, t) {
                var n = r(e, "bVisible"),
                    n = h.inArray(t, n);
                return -1 !== n ? n : null
            }

            function t(e) {
                return r(e, "bVisible").length
            }

            function r(e, t) {
                var n = [];
                return h.map(e.aoColumns, function (e, r) {
                    e[t] && n.push(r)
                }), n
            }

            function B(e) {
                for (var t = j.ext.aTypes, n = t.length, r = 0; r < n; r++) {
                    var i = t[r](e);
                    if (null !== i) return i
                }
                return "string"
            }

            function u(e, t) {
                for (var n = t.split(","), r = [], i = 0, s = e.aoColumns.length; i < s; i++)
                    for (var o = 0; o < s; o++)
                        if (e.aoColumns[i].sName == n[o]) {
                            r.push(o);
                            break
                        }
                return r
            }

            function M(e) {
                for (var t = "", n = 0, r = e.aoColumns.length; n < r; n++) t += e.aoColumns[n].sName + ",";
                return t.length == r ? "" : t.slice(0, -1)
            }

            function ta(e, t, n, r) {
                var i, s, u, a, f;
                if (t)
                    for (i = t.length - 1; 0 <= i; i--) {
                        var l = t[i].aTargets;
                        h.isArray(l) || D(e, 1, "aTargets must be an array of targets, not a " + typeof l), s = 0;
                        for (u = l.length; s < u; s++)
                            if ("number" == typeof l[s] && 0 <= l[s]) {
                                for (; e.aoColumns.length <= l[s];) o(e);
                                r(l[s], t[i])
                            } else if ("number" == typeof l[s] && 0 > l[s]) r(e.aoColumns.length + l[s], t[i]);
                        else if ("string" == typeof l[s]) {
                            a = 0;
                            for (f = e.aoColumns.length; a < f; a++)("_all" == l[s] || h(e.aoColumns[a].nTh).hasClass(l[s])) && r(a, t[i])
                        }
                    }
                if (n) {
                    i = 0;
                    for (e = n.length; i < e; i++) r(i, n[i])
                }
            }

            function H(e, t) {
                var n;
                n = h.isArray(t) ? t.slice() : h.extend(!0, {}, t);
                var r = e.aoData.length,
                    i = h.extend(!0, {}, j.models.oRow);
                i._aData = n, e.aoData.push(i);
                for (var s, i = 0, o = e.aoColumns.length; i < o; i++) n = e.aoColumns[i], "function" == typeof n.fnRender && n.bUseRendered && null !== n.mData ? F(e, r, i, S(e, r, i)) : F(e, r, i, v(e, r, i)), n._bAutoType && "string" != n.sType && (s = v(e, r, i, "type"), null !== s && "" !== s && (s = B(s), null === n.sType ? n.sType = s : n.sType != s && "html" != n.sType && (n.sType = "string")));
                return e.aiDisplayMaster.push(r), e.oFeatures.bDeferRender || ea(e, r), r
            }

            function ua(e) {
                var t, n, r, i, s, o, u;
                if (e.bDeferLoading || null === e.sAjaxSource)
                    for (t = e.nTBody.firstChild; t;) {
                        if ("TR" == t.nodeName.toUpperCase()) {
                            n = e.aoData.length, t._DT_RowIndex = n, e.aoData.push(h.extend(!0, {}, j.models.oRow, {
                                nTr: t
                            })), e.aiDisplayMaster.push(n), s = t.firstChild;
                            for (r = 0; s;) {
                                o = s.nodeName.toUpperCase();
                                if ("TD" == o || "TH" == o) F(e, n, r, h.trim(s.innerHTML)), r++;
                                s = s.nextSibling
                            }
                        }
                        t = t.nextSibling
                    }
                i = T(e), r = [], t = 0;
                for (n = i.length; t < n; t++)
                    for (s = i[t].firstChild; s;) o = s.nodeName.toUpperCase(), ("TD" == o || "TH" == o) && r.push(s), s = s.nextSibling;
                n = 0;
                for (i = e.aoColumns.length; n < i; n++) {
                    u = e.aoColumns[n], null === u.sTitle && (u.sTitle = u.nTh.innerHTML);
                    var a = u._bAutoType,
                        f = "function" == typeof u.fnRender,
                        l = null !== u.sClass,
                        c = u.bVisible,
                        p, d;
                    if (a || f || l || !c) {
                        o = 0;
                        for (t = e.aoData.length; o < t; o++) s = e.aoData[o], p = r[o * i + n], a && "string" != u.sType && (d = v(e, o, n, "type"), "" !== d && (d = B(d), null === u.sType ? u.sType = d : u.sType != d && "html" != u.sType && (u.sType = "string"))), u.mRender ? p.innerHTML = v(e, o, n, "display") : u.mData !== n && (p.innerHTML = v(e, o, n, "display")), f && (d = S(e, o, n), p.innerHTML = d, u.bUseRendered && F(e, o, n, d)), l && (p.className += " " + u.sClass), c ? s._anHidden[n] = null : (s._anHidden[n] = p, p.parentNode.removeChild(p)), u.fnCreatedCell && u.fnCreatedCell.call(e.oInstance, p, v(e, o, n, "display"), s._aData, o, n)
                    }
                }
                if (0 !== e.aoRowCreatedCallback.length) {
                    t = 0;
                    for (n = e.aoData.length; t < n; t++) s = e.aoData[t], A(e, "aoRowCreatedCallback", null, [s.nTr, s._aData, t])
                }
            }

            function I(e, t) {
                return t._DT_RowIndex !== n ? t._DT_RowIndex : null
            }

            function fa(e, t, n) {
                for (var t = J(e, t), r = 0, e = e.aoColumns.length; r < e; r++)
                    if (t[r] === n) return r;
                return -1
            }

            function Y(e, t, n, r) {
                for (var i = [], s = 0, o = r.length; s < o; s++) i.push(v(e, t, r[s], n));
                return i
            }

            function v(e, t, r, i) {
                var s = e.aoColumns[r];
                if ((r = s.fnGetData(e.aoData[t]._aData, i)) === n) return e.iDrawError != e.iDraw && null === s.sDefaultContent && (D(e, 0, "Requested unknown parameter " + ("function" == typeof s.mData ? "{mData function}" : "'" + s.mData + "'") + " from the data source for row " + t), e.iDrawError = e.iDraw), s.sDefaultContent;
                if (null === r && null !== s.sDefaultContent) r = s.sDefaultContent;
                else if ("function" == typeof r) return r();
                return "display" == i && null === r ? "" : r
            }

            function F(e, t, n, r) {
                e.aoColumns[n].fnSetData(e.aoData[t]._aData, r)
            }

            function Q(e) {
                if (null === e) return function () {
                    return null
                };
                if ("function" == typeof e) return function (t, n, r) {
                    return e(t, n, r)
                };
                if ("string" != typeof e || -1 === e.indexOf(".") && -1 === e.indexOf("[")) return function (t) {
                    return t[e]
                };
                var t = function (e, r, i) {
                    var s = i.split("."),
                        o;
                    if ("" !== i) {
                        var u = 0;
                        for (o = s.length; u < o; u++) {
                            if (i = s[u].match(U)) {
                                s[u] = s[u].replace(U, ""), "" !== s[u] && (e = e[s[u]]), o = [], s.splice(0, u + 1);
                                for (var s = s.join("."), u = 0, a = e.length; u < a; u++) o.push(t(e[u], r, s));
                                e = i[0].substring(1, i[0].length - 1), e = "" === e ? o : o.join(e);
                                break
                            }
                            if (null === e || e[s[u]] === n) return n;
                            e = e[s[u]]
                        }
                    }
                    return e
                };
                return function (n, r) {
                    return t(n, r, e)
                }
            }

            function L(e) {
                if (null === e) return function () {};
                if ("function" == typeof e) return function (t, n) {
                    e(t, "set", n)
                };
                if ("string" != typeof e || -1 === e.indexOf(".") && -1 === e.indexOf("[")) return function (t, n) {
                    t[e] = n
                };
                var t = function (e, r, i) {
                    var i = i.split("."),
                        s, o, u = 0;
                    for (o = i.length - 1; u < o; u++) {
                        if (s = i[u].match(U)) {
                            i[u] = i[u].replace(U, ""), e[i[u]] = [], s = i.slice(), s.splice(0, u + 1), o = s.join(".");
                            for (var a = 0, f = r.length; a < f; a++) s = {}, t(s, r[a], o), e[i[u]].push(s);
                            return
                        }
                        if (null === e[i[u]] || e[i[u]] === n) e[i[u]] = {};
                        e = e[i[u]]
                    }
                    e[i[i.length - 1].replace(U, "")] = r
                };
                return function (n, r) {
                    return t(n, r, e)
                }
            }

            function Z(e) {
                for (var t = [], n = e.aoData.length, r = 0; r < n; r++) t.push(e.aoData[r]._aData);
                return t
            }

            function ga(e) {
                e.aoData.splice(0, e.aoData.length), e.aiDisplayMaster.splice(0, e.aiDisplayMaster.length), e.aiDisplay.splice(0, e.aiDisplay.length), y(e)
            }

            function ha(e, t) {
                for (var n = -1, r = 0, i = e.length; r < i; r++) e[r] == t ? n = r : e[r] > t && e[r]--; - 1 != n && e.splice(n, 1)
            }

            function S(e, t, n) {
                var r = e.aoColumns[n];
                return r.fnRender({
                    iDataRow: t,
                    iDataColumn: n,
                    oSettings: e,
                    aData: e.aoData[t]._aData,
                    mDataProp: r.mData
                }, v(e, t, n, "display"))
            }

            function ea(e, t) {
                var n = e.aoData[t],
                    r;
                if (null === n.nTr) {
                    n.nTr = l.createElement("tr"), n.nTr._DT_RowIndex = t, n._aData.DT_RowId && (n.nTr.id = n._aData.DT_RowId), n._aData.DT_RowClass && (n.nTr.className = n._aData.DT_RowClass);
                    for (var i = 0, s = e.aoColumns.length; i < s; i++) {
                        var o = e.aoColumns[i];
                        r = l.createElement(o.sCellType), r.innerHTML = "function" != typeof o.fnRender || !! o.bUseRendered && null !== o.mData ? v(e, t, i, "display") : S(e, t, i), null !== o.sClass && (r.className = o.sClass), o.bVisible ? (n.nTr.appendChild(r), n._anHidden[i] = null) : n._anHidden[i] = r, o.fnCreatedCell && o.fnCreatedCell.call(e.oInstance, r, v(e, t, i, "display"), n._aData, t, i)
                    }
                    A(e, "aoRowCreatedCallback", null, [n.nTr, n._aData, t])
                }
            }

            function va(e) {
                var t, n, r;
                if (0 !== h("th, td", e.nTHead).length) {
                    t = 0;
                    for (r = e.aoColumns.length; t < r; t++)
                        if (n = e.aoColumns[t].nTh, n.setAttribute("role", "columnheader"), e.aoColumns[t].bSortable && (n.setAttribute("tabindex", e.iTabIndex), n.setAttribute("aria-controls", e.sTableId)), null !== e.aoColumns[t].sClass && h(n).addClass(e.aoColumns[t].sClass), e.aoColumns[t].sTitle != n.innerHTML) n.innerHTML = e.aoColumns[t].sTitle
                } else {
                    var i = l.createElement("tr");
                    t = 0;
                    for (r = e.aoColumns.length; t < r; t++) n = e.aoColumns[t].nTh, n.innerHTML = e.aoColumns[t].sTitle, n.setAttribute("tabindex", "0"), null !== e.aoColumns[t].sClass && h(n).addClass(e.aoColumns[t].sClass), i.appendChild(n);
                    h(e.nTHead).html("")[0].appendChild(i), V(e.aoHeader, e.nTHead)
                }
                h(e.nTHead).children("tr").attr("role", "row");
                if (e.bJUI) {
                    t = 0;
                    for (r = e.aoColumns.length; t < r; t++) {
                        n = e.aoColumns[t].nTh, i = l.createElement("div"), i.className = e.oClasses.sSortJUIWrapper, h(n).contents().appendTo(i);
                        var s = l.createElement("span");
                        s.className = e.oClasses.sSortIcon, i.appendChild(s), n.appendChild(i)
                    }
                }
                if (e.oFeatures.bSort)
                    for (t = 0; t < e.aoColumns.length; t++)!1 !== e.aoColumns[t].bSortable ? ia(e, e.aoColumns[t].nTh, t) : h(e.aoColumns[t].nTh).addClass(e.oClasses.sSortableNone);
                "" !== e.oClasses.sFooterTH && h(e.nTFoot).children("tr").children("th").addClass(e.oClasses.sFooterTH);
                if (null !== e.nTFoot) {
                    n = N(e, null, e.aoFooter), t = 0;
                    for (r = e.aoColumns.length; t < r; t++) n[t] && (e.aoColumns[t].nTf = n[t], e.aoColumns[t].sClass && h(n[t]).addClass(e.aoColumns[t].sClass))
                }
            }

            function W(e, t, r) {
                var i, s, o, u = [],
                    a = [],
                    f = e.aoColumns.length,
                    l;
                r === n && (r = !1), i = 0;
                for (s = t.length; i < s; i++) {
                    u[i] = t[i].slice(), u[i].nTr = t[i].nTr;
                    for (o = f - 1; 0 <= o; o--)!e.aoColumns[o].bVisible && !r && u[i].splice(o, 1);
                    a.push([])
                }
                i = 0;
                for (s = u.length; i < s; i++) {
                    if (e = u[i].nTr)
                        for (; o = e.firstChild;) e.removeChild(o);
                    o = 0;
                    for (t = u[i].length; o < t; o++)
                        if (l = f = 1, a[i][o] === n) {
                            e.appendChild(u[i][o].cell);
                            for (a[i][o] = 1; u[i + f] !== n && u[i][o].cell == u[i + f][o].cell;) a[i + f][o] = 1, f++;
                            for (; u[i][o + l] !== n && u[i][o].cell == u[i][o + l].cell;) {
                                for (r = 0; r < f; r++) a[i + r][o + l] = 1;
                                l++
                            }
                            u[i][o].cell.rowSpan = f, u[i][o].cell.colSpan = l
                        }
                }
            }

            function x(e) {
                var r = A(e, "aoPreDrawCallback", "preDraw", [e]);
                if (-1 !== h.inArray(!1, r)) E(e, !1);
                else {
                    var i, s, r = [],
                        o = 0,
                        u = e.asStripeClasses.length;
                    i = e.aoOpenRows.length, e.bDrawing = !0, e.iInitDisplayStart !== n && -1 != e.iInitDisplayStart && (e._iDisplayStart =
                        e.oFeatures.bServerSide ? e.iInitDisplayStart : e.iInitDisplayStart >= e.fnRecordsDisplay() ? 0 : e.iInitDisplayStart, e.iInitDisplayStart = -1, y(e));
                    if (e.bDeferLoading) e.bDeferLoading = !1, e.iDraw++;
                    else if (e.oFeatures.bServerSide) {
                        if (!e.bDestroying && !wa(e)) return
                    } else e.iDraw++; if (0 !== e.aiDisplay.length) {
                        var a = e._iDisplayStart;
                        s = e._iDisplayEnd, e.oFeatures.bServerSide && (a = 0, s = e.aoData.length);
                        for (; a < s; a++) {
                            var f = e.aoData[e.aiDisplay[a]];
                            null === f.nTr && ea(e, e.aiDisplay[a]);
                            var c = f.nTr;
                            if (0 !== u) {
                                var p = e.asStripeClasses[o % u];
                                f._sRowStripe != p && (h(c).removeClass(f._sRowStripe).addClass(p), f._sRowStripe = p)
                            }
                            A(e, "aoRowCallback", null, [c, e.aoData[e.aiDisplay[a]]._aData, o, a]), r.push(c), o++;
                            if (0 !== i)
                                for (f = 0; f < i; f++)
                                    if (c == e.aoOpenRows[f].nParent) {
                                        r.push(e.aoOpenRows[f].nTr);
                                        break
                                    }
                        }
                    } else r[0] = l.createElement("tr"), e.asStripeClasses[0] && (r[0].className = e.asStripeClasses[0]), i = e.oLanguage, u = i.sZeroRecords, 1 == e.iDraw && null !== e.sAjaxSource && !e.oFeatures.bServerSide ? u = i.sLoadingRecords : i.sEmptyTable && 0 === e.fnRecordsTotal() && (u = i.sEmptyTable), i = l.createElement("td"), i.setAttribute("valign", "top"), i.colSpan = t(e), i.className = e.oClasses.sRowEmpty, i.innerHTML = ja(e, u), r[o].appendChild(i);
                    A(e, "aoHeaderCallback", "header", [h(e.nTHead).children("tr")[0], Z(e), e._iDisplayStart, e.fnDisplayEnd(), e.aiDisplay]), A(e, "aoFooterCallback", "footer", [h(e.nTFoot).children("tr")[0], Z(e), e._iDisplayStart, e.fnDisplayEnd(), e.aiDisplay]), o = l.createDocumentFragment(), i = l.createDocumentFragment();
                    if (e.nTBody) {
                        u = e.nTBody.parentNode, i.appendChild(e.nTBody);
                        if (!e.oScroll.bInfinite || !e._bInitComplete || e.bSorted || e.bFiltered)
                            for (; i = e.nTBody.firstChild;) e.nTBody.removeChild(i);
                        i = 0;
                        for (s = r.length; i < s; i++) o.appendChild(r[i]);
                        e.nTBody.appendChild(o), null !== u && u.appendChild(e.nTBody)
                    }
                    A(e, "aoDrawCallback", "draw", [e]), e.bSorted = !1, e.bFiltered = !1, e.bDrawing = !1, e.oFeatures.bServerSide && (E(e, !1), e._bInitComplete || $(e))
                }
            }

            function aa(e) {
                e.oFeatures.bSort ? O(e, e.oPreviousSearch) : e.oFeatures.bFilter ? K(e, e.oPreviousSearch) : (y(e), x(e))
            }

            function xa(e) {
                var t = h("<div></div>")[0];
                e.nTable.parentNode.insertBefore(t, e.nTable), e.nTableWrapper = h('<div id="' + e.sTableId + '_wrapper" class="' + e.oClasses.sWrapper + '" role="grid"></div>')[0], e.nTableReinsertBefore = e.nTable.nextSibling;
                for (var n = e.nTableWrapper, r = e.sDom.split(""), i, s, o, u, a, f, l, c = 0; c < r.length; c++) {
                    s = 0, o = r[c];
                    if ("<" == o) {
                        u = h("<div></div>")[0], a = r[c + 1];
                        if ("'" == a || '"' == a) {
                            f = "";
                            for (l = 2; r[c + l] != a;) f += r[c + l], l++;
                            "H" == f ? f = e.oClasses.sJUIHeader : "F" == f && (f = e.oClasses.sJUIFooter), -1 != f.indexOf(".") ? (a = f.split("."), u.id = a[0].substr(1, a[0].length - 1), u.className = a[1]) : "#" == f.charAt(0) ? u.id = f.substr(1, f.length - 1) : u.className = f, c += l
                        }
                        n.appendChild(u), n = u
                    } else if (">" == o) n = n.parentNode;
                    else if ("l" == o && e.oFeatures.bPaginate && e.oFeatures.bLengthChange) i = ya(e), s = 1;
                    else if ("f" == o && e.oFeatures.bFilter) i = za(e), s = 1;
                    else if ("r" == o && e.oFeatures.bProcessing) i = Aa(e), s = 1;
                    else if ("t" == o) i = Ba(e), s = 1;
                    else if ("i" == o && e.oFeatures.bInfo) i = Ca(e), s = 1;
                    else if ("p" == o && e.oFeatures.bPaginate) i = Da(e), s = 1;
                    else if (0 !== j.ext.aoFeatures.length) {
                        u = j.ext.aoFeatures, l = 0;
                        for (a = u.length; l < a; l++)
                            if (o == u[l].cFeature) {
                                (i = u[l].fnInit(e)) && (s = 1);
                                break
                            }
                    }
                    1 == s && null !== i && ("object" != typeof e.aanFeatures[o] && (e.aanFeatures[o] = []), e.aanFeatures[o].push(i), n.appendChild(i))
                }
                t.parentNode.replaceChild(e.nTableWrapper, t)
            }

            function V(e, t) {
                var n = h(t).children("tr"),
                    r, i, s, o, u, a, f, l, c, p;
                e.splice(0, e.length), s = 0;
                for (a = n.length; s < a; s++) e.push([]);
                s = 0;
                for (a = n.length; s < a; s++) {
                    r = n[s];
                    for (i = r.firstChild; i;) {
                        if ("TD" == i.nodeName.toUpperCase() || "TH" == i.nodeName.toUpperCase()) {
                            l = 1 * i.getAttribute("colspan"), c = 1 * i.getAttribute("rowspan"), l = !l || 0 === l || 1 === l ? 1 : l, c = !c || 0 === c || 1 === c ? 1 : c, o = 0;
                            for (u = e[s]; u[o];) o++;
                            f = o, p = 1 === l ? !0 : !1;
                            for (u = 0; u < l; u++)
                                for (o = 0; o < c; o++) e[s + o][f + u] = {
                                    cell: i,
                                    unique: p
                                }, e[s + o].nTr = r
                        }
                        i = i.nextSibling
                    }
                }
            }

            function N(e, t, n) {
                var r = [];
                n || (n = e.aoHeader, t && (n = [], V(n, t)));
                for (var t = 0, i = n.length; t < i; t++)
                    for (var s = 0, o = n[t].length; s < o; s++) n[t][s].unique && (!r[s] || !e.bSortCellsTop) && (r[s] = n[t][s].cell);
                return r
            }

            function wa(e) {
                if (e.bAjaxDataGet) {
                    e.iDraw++, E(e, !0);
                    var t = Ea(e);
                    return ka(e, t), e.fnServerData.call(e.oInstance, e.sAjaxSource, t, function (t) {
                        Fa(e, t)
                    }, e), !1
                }
                return !0
            }

            function Ea(e) {
                var t = e.aoColumns.length,
                    n = [],
                    r, i, s, o;
                n.push({
                    name: "sEcho",
                    value: e.iDraw
                }), n.push({
                    name: "iColumns",
                    value: t
                }), n.push({
                    name: "sColumns",
                    value: M(e)
                }), n.push({
                    name: "iDisplayStart",
                    value: e._iDisplayStart
                }), n.push({
                    name: "iDisplayLength",
                    value: !1 !== e.oFeatures.bPaginate ? e._iDisplayLength : -1
                });
                for (s = 0; s < t; s++) r = e.aoColumns[s].mData, n.push({
                    name: "mDataProp_" + s,
                    value: "function" == typeof r ? "function" : r
                });
                if (!1 !== e.oFeatures.bFilter) {
                    n.push({
                        name: "sSearch",
                        value: e.oPreviousSearch.sSearch
                    }), n.push({
                        name: "bRegex",
                        value: e.oPreviousSearch.bRegex
                    });
                    for (s = 0; s < t; s++) n.push({
                        name: "sSearch_" + s,
                        value: e.aoPreSearchCols[s].sSearch
                    }), n.push({
                        name: "bRegex_" + s,
                        value: e.aoPreSearchCols[s].bRegex
                    }), n.push({
                        name: "bSearchable_" + s,
                        value: e.aoColumns[s].bSearchable
                    })
                }
                if (!1 !== e.oFeatures.bSort) {
                    var u = 0;
                    r = null !== e.aaSortingFixed ? e.aaSortingFixed.concat(e.aaSorting) : e.aaSorting.slice();
                    for (s = 0; s < r.length; s++) {
                        i = e.aoColumns[r[s][0]].aDataSort;
                        for (o = 0; o < i.length; o++) n.push({
                            name: "iSortCol_" + u,
                            value: i[o]
                        }), n.push({
                            name: "sSortDir_" + u,
                            value: r[s][1]
                        }), u++
                    }
                    n.push({
                        name: "iSortingCols",
                        value: u
                    });
                    for (s = 0; s < t; s++) n.push({
                        name: "bSortable_" + s,
                        value: e.aoColumns[s].bSortable
                    })
                }
                return n
            }

            function ka(e, t) {
                A(e, "aoServerParams", "serverParams", [t])
            }

            function Fa(e, t) {
                if (t.sEcho !== n) {
                    if (1 * t.sEcho < e.iDraw) return;
                    e.iDraw = 1 * t.sEcho
                }(!e.oScroll.bInfinite || e.oScroll.bInfinite && (e.bSorted || e.bFiltered)) && ga(e), e._iRecordsTotal = parseInt(t.iTotalRecords, 10), e._iRecordsDisplay = parseInt(t.iTotalDisplayRecords, 10);
                var r = M(e),
                    r = t.sColumns !== n && "" !== r && t.sColumns != r,
                    i;
                r && (i = u(e, t.sColumns));
                for (var s = Q(e.sAjaxDataProp)(t), o = 0, a = s.length; o < a; o++)
                    if (r) {
                        for (var f = [], l = 0, c = e.aoColumns.length; l < c; l++) f.push(s[o][i[l]]);
                        H(e, f)
                    } else H(e, s[o]);
                e.aiDisplay = e.aiDisplayMaster.slice(), e.bAjaxDataGet = !1, x(e), e.bAjaxDataGet = !0, E(e, !1)
            }

            function za(e) {
                var t = e.oPreviousSearch,
                    n = e.oLanguage.sSearch,
                    n = -1 !== n.indexOf("_INPUT_") ? n.replace("_INPUT_", '<input type="text" />') : "" === n ? '<input type="text" />' : n + ' <input type="text" />',
                    r = l.createElement("div");
                return r.className = e.oClasses.sFilter, r.innerHTML = "<label>" + n + "</label>", e.aanFeatures.f || (r.id = e.sTableId + "_filter"), n = h('input[type="text"]', r), r._DT_Input = n[0], n.val(t.sSearch.replace('"', "&quot;")), n.bind("keyup.DT", function () {
                    for (var n = e.aanFeatures.f, r = this.value === "" ? "" : this.value, i = 0, s = n.length; i < s; i++) n[i] != h(this).parents("div.dataTables_filter")[0] && h(n[i]._DT_Input).val(r);
                    r != t.sSearch && K(e, {
                        sSearch: r,
                        bRegex: t.bRegex,
                        bSmart: t.bSmart,
                        bCaseInsensitive: t.bCaseInsensitive
                    })
                }), n.attr("aria-controls", e.sTableId).bind("keypress.DT", function (e) {
                    if (e.keyCode == 13) return !1
                }), r
            }

            function K(e, t, n) {
                var r = e.oPreviousSearch,
                    i = e.aoPreSearchCols,
                    s = function (e) {
                        r.sSearch = e.sSearch, r.bRegex = e.bRegex, r.bSmart = e.bSmart, r.bCaseInsensitive = e.bCaseInsensitive
                    };
                if (e.oFeatures.bServerSide) s(t);
                else {
                    Ga(e, t.sSearch, n, t.bRegex, t.bSmart, t.bCaseInsensitive), s(t);
                    for (t = 0; t < e.aoPreSearchCols.length; t++) Ha(e, i[t].sSearch, t, i[t].bRegex, i[t].bSmart, i[t].bCaseInsensitive);
                    Ia(e)
                }
                e.bFiltered = !0, h(e.oInstance).trigger("filter", e), e._iDisplayStart = 0, y(e), x(e), la(e, 0)
            }

            function Ia(e) {
                for (var t = j.ext.afnFiltering, n = r(e, "bSearchable"), i = 0, s = t.length; i < s; i++)
                    for (var o = 0, u = 0, a = e.aiDisplay.length; u < a; u++) {
                        var f = e.aiDisplay[u - o];
                        t[i](e, Y(e, f, "filter", n), f) || (e.aiDisplay.splice(u - o, 1), o++)
                    }
            }

            function Ha(e, t, n, r, i, s) {
                if ("" !== t)
                    for (var o = 0, t = ma(t, r, i, s), r = e.aiDisplay.length - 1; 0 <= r; r--) i = Ja(v(e, e.aiDisplay[r], n, "filter"), e.aoColumns[n].sType), t.test(i) || (e.aiDisplay.splice(r, 1), o++)
            }

            function Ga(e, t, n, r, i, s) {
                r = ma(t, r, i, s), i = e.oPreviousSearch, n || (n = 0), 0 !== j.ext.afnFiltering.length && (n = 1);
                if (0 >= t.length) e.aiDisplay.splice(0, e.aiDisplay.length), e.aiDisplay = e.aiDisplayMaster.slice();
                else if (e.aiDisplay.length == e.aiDisplayMaster.length || i.sSearch.length > t.length || 1 == n || 0 !== t.indexOf(i.sSearch)) {
                    e.aiDisplay.splice(0, e.aiDisplay.length), la(e, 1);
                    for (t = 0; t < e.aiDisplayMaster.length; t++) r.test(e.asDataSearch[t]) && e.aiDisplay.push(e.aiDisplayMaster[t])
                } else
                    for (t = n = 0; t < e.asDataSearch.length; t++) r.test(e.asDataSearch[t]) || (e.aiDisplay.splice(t - n, 1), n++)
            }

            function la(e, t) {
                if (!e.oFeatures.bServerSide) {
                    e.asDataSearch = [];
                    for (var n = r(e, "bSearchable"), i = 1 === t ? e.aiDisplayMaster : e.aiDisplay, s = 0, o = i.length; s < o; s++) e.asDataSearch[s] = na(e, Y(e, i[s], "filter", n))
                }
            }

            function na(e, t) {
                var n = t.join("  ");
                return -1 !== n.indexOf("&") && (n = h("<div>").html(n).text()), n.replace(/[\n\r]/g, " ")
            }

            function ma(e, t, n, r) {
                return n ? (e = t ? e.split(" ") : oa(e).split(" "), e = "^(?=.*?" + e.join(")(?=.*?") + ").*$", RegExp(e, r ? "i" : "")) : (e = t ? e : oa(e), RegExp(e, r ? "i" : ""))
            }

            function Ja(e, t) {
                return "function" == typeof j.ext.ofnSearch[t] ? j.ext.ofnSearch[t](e) : null === e ? "" : "html" == t ? e.replace(/[\r\n]/g, " ").replace(/<.*?>/g, "") : "string" == typeof e ? e.replace(/[\r\n]/g, " ") : e
            }

            function oa(e) {
                return e.replace(RegExp("(\\/|\\.|\\*|\\+|\\?|\\||\\(|\\)|\\[|\\]|\\{|\\}|\\\\|\\$|\\^|\\-)", "g"), "\\$1")
            }

            function Ca(e) {
                var t = l.createElement("div");
                return t.className = e.oClasses.sInfo, e.aanFeatures.i || (e.aoDrawCallback.push({
                    fn: Ka,
                    sName: "information"
                }), t.id = e.sTableId + "_info"), e.nTable.setAttribute("aria-describedby", e.sTableId + "_info"), t
            }

            function Ka(e) {
                if (e.oFeatures.bInfo && 0 !== e.aanFeatures.i.length) {
                    var t = e.oLanguage,
                        n = e._iDisplayStart + 1,
                        r = e.fnDisplayEnd(),
                        i = e.fnRecordsTotal(),
                        s = e.fnRecordsDisplay(),
                        o;
                    o = 0 === s ? t.sInfoEmpty : t.sInfo, s != i && (o += " " + t.sInfoFiltered), o += t.sInfoPostFix, o = ja(e, o), null !== t.fnInfoCallback && (o = t.fnInfoCallback.call(e.oInstance, e, n, r, i, s, o)), e = e.aanFeatures.i, t = 0;
                    for (n = e.length; t < n; t++) h(e[t]).html(o)
                }
            }

            function ja(e, t) {
                var n = e.fnFormatNumber(e._iDisplayStart + 1),
                    r = e.fnDisplayEnd(),
                    r = e.fnFormatNumber(r),
                    i = e.fnRecordsDisplay(),
                    i = e.fnFormatNumber(i),
                    s = e.fnRecordsTotal(),
                    s = e.fnFormatNumber(s);
                return e.oScroll.bInfinite && (n = e.fnFormatNumber(1)), t.replace(/_START_/g, n).replace(/_END_/g, r).replace(/_TOTAL_/g, i).replace(/_MAX_/g, s)
            }

            function ba(e) {
                var t, n, r = e.iInitDisplayStart;
                if (!1 === e.bInitialised) setTimeout(function () {
                    ba(e)
                }, 200);
                else {
                    xa(e), va(e), W(e, e.aoHeader), e.nTFoot && W(e, e.aoFooter), E(e, !0), e.oFeatures.bAutoWidth && da(e), t = 0;
                    for (n = e.aoColumns.length; t < n; t++) null !== e.aoColumns[t].sWidth && (e.aoColumns[t].nTh.style.width = q(e.aoColumns[t].sWidth));
                    e.oFeatures.bSort ? O(e) : e.oFeatures.bFilter ? K(e, e.oPreviousSearch) : (e.aiDisplay = e.aiDisplayMaster.slice(), y(e), x(e)), null !== e.sAjaxSource && !e.oFeatures.bServerSide ? (n = [], ka(e, n), e.fnServerData.call(e.oInstance, e.sAjaxSource, n, function (n) {
                        var i = e.sAjaxDataProp !== "" ? Q(e.sAjaxDataProp)(n) : n;
                        for (t = 0; t < i.length; t++) H(e, i[t]);
                        e.iInitDisplayStart = r, e.oFeatures.bSort ? O(e) : (e.aiDisplay = e.aiDisplayMaster.slice(), y(e), x(e)), E(e, !1), $(e, n)
                    }, e)) : e.oFeatures.bServerSide || (E(e, !1), $(e))
                }
            }

            function $(e, t) {
                e._bInitComplete = !0, A(e, "aoInitComplete", "init", [e, t])
            }

            function pa(e) {
                var t = j.defaults.oLanguage;
                !e.sEmptyTable && e.sZeroRecords && "No data available in table" === t.sEmptyTable && p(e, e, "sZeroRecords", "sEmptyTable"), !e.sLoadingRecords && e.sZeroRecords && "Loading..." === t.sLoadingRecords && p(e, e, "sZeroRecords", "sLoadingRecords")
            }

            function ya(e) {
                if (e.oScroll.bInfinite) return null;
                var t = '<select size="1" ' + ('name="' + e.sTableId + '_length"') + ">",
                    n, r, i = e.aLengthMenu;
                if (2 == i.length && "object" == typeof i[0] && "object" == typeof i[1]) {
                    n = 0;
                    for (r = i[0].length; n < r; n++) t += '<option value="' + i[0][n] + '">' + i[1][n] + "</option>"
                } else {
                    n = 0;
                    for (r = i.length; n < r; n++) t += '<option value="' + i[n] + '">' + i[n] + "</option>"
                }
                return t += "</select>", i = l.createElement("div"), e.aanFeatures.l || (i.id = e.sTableId + "_length"), i.className = e.oClasses.sLength, i.innerHTML = "<label>" + e.oLanguage.sLengthMenu.replace("_MENU_", t) + "</label>", h('select option[value="' + e._iDisplayLength + '"]', i).attr("selected", !0), h("select", i).bind("change.DT", function () {
                    var t = h(this).val(),
                        i = e.aanFeatures.l;
                    n = 0;
                    for (r = i.length; n < r; n++) i[n] != this.parentNode && h("select", i[n]).val(t);
                    e._iDisplayLength = parseInt(t, 10), y(e), e.fnDisplayEnd() == e.fnRecordsDisplay() && (e._iDisplayStart = e.fnDisplayEnd() - e._iDisplayLength, e._iDisplayStart < 0 && (e._iDisplayStart = 0)), e._iDisplayLength == -1 && (e._iDisplayStart = 0), x(e)
                }), h("select", i).attr("aria-controls", e.sTableId), i
            }

            function y(e) {
                e._iDisplayEnd = !1 === e.oFeatures.bPaginate ? e.aiDisplay.length : e._iDisplayStart + e._iDisplayLength > e.aiDisplay.length || -1 == e._iDisplayLength ? e.aiDisplay.length : e._iDisplayStart + e._iDisplayLength
            }

            function Da(e) {
                if (e.oScroll.bInfinite) return null;
                var t = l.createElement("div");
                return t.className = e.oClasses.sPaging + e.sPaginationType, j.ext.oPagination[e.sPaginationType].fnInit(e, t, function (e) {
                    y(e), x(e)
                }), e.aanFeatures.p || e.aoDrawCallback.push({
                    fn: function (e) {
                        j.ext.oPagination[e.sPaginationType].fnUpdate(e, function (e) {
                            y(e), x(e)
                        })
                    },
                    sName: "pagination"
                }), t
            }

            function qa(e, t) {
                var n = e._iDisplayStart;
                if ("number" == typeof t) e._iDisplayStart = t * e._iDisplayLength, e._iDisplayStart > e.fnRecordsDisplay() && (e._iDisplayStart = 0);
                else if ("first" == t) e._iDisplayStart = 0;
                else if ("previous" == t) e._iDisplayStart = 0 <= e._iDisplayLength ? e._iDisplayStart - e._iDisplayLength : 0, 0 > e._iDisplayStart && (e._iDisplayStart = 0);
                else if ("next" == t) 0 <= e._iDisplayLength ? e._iDisplayStart + e._iDisplayLength < e.fnRecordsDisplay() && (e._iDisplayStart += e._iDisplayLength) : e._iDisplayStart = 0;
                else if ("last" == t)
                    if (0 <= e._iDisplayLength) {
                        var r = parseInt((e.fnRecordsDisplay() - 1) / e._iDisplayLength, 10) + 1;
                        e._iDisplayStart = (r - 1) * e._iDisplayLength
                    } else e._iDisplayStart = 0;
                    else D(e, 0, "Unknown paging action: " + t);
                return h(e.oInstance).trigger("page", e), n != e._iDisplayStart
            }

            function Aa(e) {
                var t = l.createElement("div");
                return e.aanFeatures.r || (t.id = e.sTableId + "_processing"), t.innerHTML = e.oLanguage.sProcessing, t.className = e.oClasses.sProcessing, e.nTable.parentNode.insertBefore(t, e.nTable), t
            }

            function E(e, t) {
                if (e.oFeatures.bProcessing)
                    for (var n = e.aanFeatures.r, r = 0, i = n.length; r < i; r++) n[r].style.visibility = t ? "visible" : "hidden";
                h(e.oInstance).trigger("processing", [e, t])
            }

            function Ba(e) {
                if ("" === e.oScroll.sX && "" === e.oScroll.sY) return e.nTable;
                var t = l.createElement("div"),
                    n = l.createElement("div"),
                    r = l.createElement("div"),
                    i = l.createElement("div"),
                    s = l.createElement("div"),
                    o = l.createElement("div"),
                    u = e.nTable.cloneNode(!1),
                    a = e.nTable.cloneNode(!1),
                    f = e.nTable.getElementsByTagName("thead")[0],
                    c = 0 === e.nTable.getElementsByTagName("tfoot").length ? null : e.nTable.getElementsByTagName("tfoot")[0],
                    p = e.oClasses;
                return n.appendChild(r), s.appendChild(o), i.appendChild(e.nTable), t.appendChild(n), t.appendChild(i), r.appendChild(u), u.appendChild(f), null !== c && (t.appendChild(s), o.appendChild(a), a.appendChild(c)), t.className = p.sScrollWrapper, n.className = p.sScrollHead, r.className = p.sScrollHeadInner, i.className = p.sScrollBody, s.className = p.sScrollFoot, o.className = p.sScrollFootInner, e.oScroll.bAutoCss && (n.style.overflow = "hidden", n.style.position = "relative", s.style.overflow = "hidden", i.style.overflow = "auto"), n.style.border = "0", n.style.width = "100%", s.style.border = "0", r.style.width = "" !== e.oScroll.sXInner ? e.oScroll.sXInner : "100%", u.removeAttribute("id"), u.style.marginLeft = "0", e.nTable.style.marginLeft = "0", null !== c && (a.removeAttribute("id"), a.style.marginLeft = "0"), r = h(e.nTable).children("caption"), 0 < r.length && (r = r[0], "top" === r._captionSide ? u.appendChild(r) : "bottom" === r._captionSide && c && a.appendChild(r)), "" !== e.oScroll.sX && (n.style.width = q(e.oScroll.sX), i.style.width = q(e.oScroll.sX), null !== c && (s.style.width = q(e.oScroll.sX)), h(i).scroll(function () {
                    n.scrollLeft = this.scrollLeft, c !== null && (s.scrollLeft = this.scrollLeft)
                })), "" !== e.oScroll.sY && (i.style.height = q(e.oScroll.sY)), e.aoDrawCallback.push({
                    fn: La,
                    sName: "scrolling"
                }), e.oScroll.bInfinite && h(i).scroll(function () {
                    !e.bDrawing && h(this).scrollTop() !== 0 && h(this).scrollTop() + h(this).height() > h(e.nTable).height() - e.oScroll.iLoadGap && e.fnDisplayEnd() < e.fnRecordsDisplay() && (qa(e, "next"), y(e), x(e))
                }), e.nScrollHead = n, e.nScrollFoot = s, t
            }

            function La(e) {
                var t = e.nScrollHead.getElementsByTagName("div")[0],
                    n = t.getElementsByTagName("table")[0],
                    r = e.nTable.parentNode,
                    i, s, o, u, a, f, l, c, p = [],
                    d = [],
                    v = null !== e.nTFoot ? e.nScrollFoot.getElementsByTagName("div")[0] : null,
                    m = null !== e.nTFoot ? v.getElementsByTagName("table")[0] : null,
                    g = e.oBrowser.bScrollOversize,
                    y = function (e) {
                        l = e.style, l.paddingTop = "0", l.paddingBottom = "0", l.borderTopWidth = "0", l.borderBottomWidth = "0", l.height = 0
                    };
                h(e.nTable).children("thead, tfoot").remove(), i = h(e.nTHead).clone()[0], e.nTable.insertBefore(i, e.nTable.childNodes[0]), o = e.nTHead.getElementsByTagName("tr"), u = i.getElementsByTagName("tr"), null !== e.nTFoot && (a = h(e.nTFoot).clone()[0], e.nTable.insertBefore(a, e.nTable.childNodes[1]), f = e.nTFoot.getElementsByTagName("tr"), a = a.getElementsByTagName("tr")), "" === e.oScroll.sX && (r.style.width = "100%", t.parentNode.style.width = "100%");
                var b = N(e, i);
                i = 0;
                for (s = b.length; i < s; i++) c = G(e, i), b[i].style.width = e.aoColumns[c].sWidth;
                null !== e.nTFoot && C(function (e) {
                    e.style.width = ""
                }, a), e.oScroll.bCollapse && "" !== e.oScroll.sY && (r.style.height = r.offsetHeight + e.nTHead.offsetHeight + "px"), i = h(e.nTable).outerWidth();
                if ("" === e.oScroll.sX) {
                    if (e.nTable.style.width = "100%", g && (h("tbody", r).height() > r.offsetHeight || "scroll" == h(r).css("overflow-y"))) e.nTable.style.width = q(h(e.nTable).outerWidth() - e.oScroll.iBarWidth)
                } else "" !== e.oScroll.sXInner ? e.nTable.style.width = q(e.oScroll.sXInner) : i == h(r).width() && h(r).height() < h(e.nTable).height() ? (e.nTable.style.width = q(i - e.oScroll.iBarWidth), h(e.nTable).outerWidth() > i - e.oScroll.iBarWidth && (e.nTable.style.width = q(i))) : e.nTable.style.width = q(i);
                i = h(e.nTable).outerWidth(), C(y, u), C(function (e) {
                    p.push(q(h(e).width()))
                }, u), C(function (e, t) {
                    e.style.width = p[t]
                }, o), h(u).height(0), null !== e.nTFoot && (C(y, a), C(function (e) {
                    d.push(q(h(e).width()))
                }, a), C(function (e, t) {
                    e.style.width = d[t]
                }, f), h(a).height(0)), C(function (e, t) {
                    e.innerHTML = "", e.style.width = p[t]
                }, u), null !== e.nTFoot && C(function (e, t) {
                    e.innerHTML = "", e.style.width = d[t]
                }, a), h(e.nTable).outerWidth() < i ? (o = r.scrollHeight > r.offsetHeight || "scroll" == h(r).css("overflow-y") ? i + e.oScroll.iBarWidth : i, g && (r.scrollHeight > r.offsetHeight || "scroll" == h(r).css("overflow-y")) && (e.nTable.style.width = q(o - e.oScroll.iBarWidth)), r.style.width = q(o), e.nScrollHead.style.width = q(o), null !== e.nTFoot && (e.nScrollFoot.style.width = q(o)), "" === e.oScroll.sX ? D(e, 1, "The table cannot fit into the current element which will cause column misalignment. The table has been drawn at its minimum possible width.") : "" !== e.oScroll.sXInner && D(e, 1, "The table cannot fit into the current element which will cause column misalignment. Increase the sScrollXInner value or remove it to allow automatic calculation")) : (r.style.width = q("100%"), e.nScrollHead.style.width = q("100%"), null !== e.nTFoot && (e.nScrollFoot.style.width = q("100%"))), "" === e.oScroll.sY && g && (r.style.height = q(e.nTable.offsetHeight + e.oScroll.iBarWidth)), "" !== e.oScroll.sY && e.oScroll.bCollapse && (r.style.height = q(e.oScroll.sY), g = "" !== e.oScroll.sX && e.nTable.offsetWidth > r.offsetWidth ? e.oScroll.iBarWidth : 0, e.nTable.offsetHeight < r.offsetHeight && (r.style.height = q(e.nTable.offsetHeight + g))), g = h(e.nTable).outerWidth(), n.style.width = q(g), t.style.width = q(g), n = h(e.nTable).height() > r.clientHeight || "scroll" == h(r).css("overflow-y"), t.style.paddingRight = n ? e.oScroll.iBarWidth + "px" : "0px", null !== e.nTFoot && (m.style.width = q(g), v.style.width = q(g), v.style.paddingRight = n ? e.oScroll.iBarWidth + "px" : "0px"), h(r).scroll();
                if (e.bSorted || e.bFiltered) r.scrollTop = 0
            }

            function C(e, t, n) {
                for (var r = 0, i = 0, s = t.length, o, u; i < s;) {
                    o = t[i].firstChild;
                    for (u = n ? n[i].firstChild : null; o;) 1 === o.nodeType && (n ? e(o, u, r) : e(o, r), r++), o = o.nextSibling, u = n ? u.nextSibling : null;
                    i++
                }
            }

            function Ma(e, t) {
                if (!e || null === e || "" === e) return 0;
                t || (t = l.body);
                var n, r = l.createElement("div");
                return r.style.width = q(e), t.appendChild(r), n = r.offsetWidth, t.removeChild(r), n
            }

            function da(e) {
                var t = 0,
                    n, r = 0,
                    i = e.aoColumns.length,
                    s, o, u = h("th", e.nTHead),
                    a = e.nTable.getAttribute("width");
                o = e.nTable.parentNode;
                for (s = 0; s < i; s++) e.aoColumns[s].bVisible && (r++, null !== e.aoColumns[s].sWidth && (n = Ma(e.aoColumns[s].sWidthOrig, o), null !== n && (e.aoColumns[s].sWidth = q(n)), t++));
                if (i == u.length && 0 === t && r == i && "" === e.oScroll.sX && "" === e.oScroll.sY)
                    for (s = 0; s < e.aoColumns.length; s++) n = h(u[s]).width(), null !== n && (e.aoColumns[s].sWidth = q(n));
                else {
                    t = e.nTable.cloneNode(!1), s = e.nTHead.cloneNode(!0), r = l.createElement("tbody"), n = l.createElement("tr"), t.removeAttribute("id"), t.appendChild(s), null !== e.nTFoot && (t.appendChild(e.nTFoot.cloneNode(!0)), C(function (e) {
                        e.style.width = ""
                    }, t.getElementsByTagName("tr"))), t.appendChild(r), r.appendChild(n), r = h("thead th", t), 0 === r.length && (r = h("tbody tr:eq(0)>td", t)), u = N(e, s);
                    for (s = r = 0; s < i; s++) {
                        var f = e.aoColumns[s];
                        f.bVisible && null !== f.sWidthOrig && "" !== f.sWidthOrig ? u[s - r].style.width = q(f.sWidthOrig) : f.bVisible ? u[s - r].style.width = "" : r++
                    }
                    for (s = 0; s < i; s++) e.aoColumns[s].bVisible && (r = Na(e, s), null !== r && (r = r.cloneNode(!0), "" !== e.aoColumns[s].sContentPadding && (r.innerHTML += e.aoColumns[s].sContentPadding), n.appendChild(r)));
                    o.appendChild(t), "" !== e.oScroll.sX && "" !== e.oScroll.sXInner ? t.style.width = q(e.oScroll.sXInner) : "" !== e.oScroll.sX ? (t.style.width = "", h(t).width() < o.offsetWidth && (t.style.width = q(o.offsetWidth))) : "" !== e.oScroll.sY ? t.style.width = q(o.offsetWidth) : a && (t.style.width = q(a)), t.style.visibility = "hidden", Oa(e, t), i = h("tbody tr:eq(0)", t).children(), 0 === i.length && (i = N(e, h("thead", t)[0]));
                    if ("" !== e.oScroll.sX) {
                        for (s = r = o = 0; s < e.aoColumns.length; s++) e.aoColumns[s].bVisible && (o = null === e.aoColumns[s].sWidthOrig ? o + h(i[r]).outerWidth() : o + (parseInt(e.aoColumns[s].sWidth.replace("px", ""), 10) + (h(i[r]).outerWidth() - h(i[r]).width())), r++);
                        t.style.width = q(o), e.nTable.style.width = q(o)
                    }
                    for (s = r = 0; s < e.aoColumns.length; s++) e.aoColumns[s].bVisible && (o = h(i[r]).width(), null !== o && 0 < o && (e.aoColumns[s].sWidth = q(o)), r++);
                    i = h(t).css("width"), e.nTable.style.width = -1 !== i.indexOf("%") ? i : q(h(t).outerWidth()), t.parentNode.removeChild(t)
                }
                a && (e.nTable.style.width = q(a))
            }

            function Oa(e, t) {
                "" === e.oScroll.sX && "" !== e.oScroll.sY ? (h(t).width(), t.style.width = q(h(t).outerWidth() - e.oScroll.iBarWidth)) : "" !== e.oScroll.sX && (t.style.width = q(h(t).outerWidth()))
            }

            function Na(e, t) {
                var n = Pa(e, t);
                if (0 > n) return null;
                if (null === e.aoData[n].nTr) {
                    var r = l.createElement("td");
                    return r.innerHTML = v(e, n, t, ""), r
                }
                return J(e, n)[t]
            }

            function Pa(e, t) {
                for (var n = -1, r = -1, i = 0; i < e.aoData.length; i++) {
                    var s = v(e, i, t, "display") + "",
                        s = s.replace(/<.*?>/g, "");
                    s.length > n && (n = s.length, r = i)
                }
                return r
            }

            function q(e) {
                if (null === e) return "0px";
                if ("number" == typeof e) return 0 > e ? "0px" : e + "px";
                var t = e.charCodeAt(e.length - 1);
                return 48 > t || 57 < t ? e : e + "px"
            }

            function Qa() {
                var e = l.createElement("p"),
                    t = e.style;
                t.width = "100%", t.height = "200px", t.padding = "0px";
                var n = l.createElement("div"),
                    t = n.style;
                return t.position = "absolute", t.top = "0px", t.left = "0px", t.visibility = "hidden", t.width = "200px", t.height = "150px", t.padding = "0px", t.overflow = "hidden", n.appendChild(e), l.body.appendChild(n), t = e.offsetWidth, n.style.overflow = "scroll", e = e.offsetWidth, t == e && (e = n.clientWidth), l.body.removeChild(n), t - e
            }

            function O(e, t) {
                var r, i, s, o, u, a, f = [],
                    l = [],
                    c = j.ext.oSort,
                    p = e.aoData,
                    d = e.aoColumns,
                    m = e.oLanguage.oAria;
                if (!e.oFeatures.bServerSide && (0 !== e.aaSorting.length || null !== e.aaSortingFixed)) {
                    f = null !== e.aaSortingFixed ? e.aaSortingFixed.concat(e.aaSorting) : e.aaSorting.slice();
                    for (r = 0; r < f.length; r++)
                        if (i = f[r][0], s = R(e, i), o = e.aoColumns[i].sSortDataType, j.ext.afnSortData[o])
                            if (u = j.ext.afnSortData[o].call(e.oInstance, e, i, s), u.length === p.length) {
                                s = 0;
                                for (o = p.length; s < o; s++) F(e, s, i, u[s])
                            } else D(e, 0, "Returned data sort array (col " + i + ") is the wrong length");
                    r = 0;
                    for (i = e.aiDisplayMaster.length; r < i; r++) l[e.aiDisplayMaster[r]] = r;
                    var g = f.length,
                        b;
                    r = 0;
                    for (i = p.length; r < i; r++)
                        for (s = 0; s < g; s++) {
                            b = d[f[s][0]].aDataSort, u = 0;
                            for (a = b.length; u < a; u++) o = d[b[u]].sType, o = c[(o ? o : "string") + "-pre"], p[r]._aSortData[b[u]] = o ? o(v(e, r, b[u], "sort")) : v(e, r, b[u], "sort")
                        }
                    e.aiDisplayMaster.sort(function (e, t) {
                        var n, r, i, s, o;
                        for (n = 0; n < g; n++) {
                            o = d[f[n][0]].aDataSort, r = 0;
                            for (i = o.length; r < i; r++)
                                if (s = d[o[r]].sType, s = c[(s ? s : "string") + "-" + f[n][1]](p[e]._aSortData[o[r]], p[t]._aSortData[o[r]]), 0 !== s) return s
                        }
                        return c["numeric-asc"](l[e], l[t])
                    })
                }(t === n || t) && !e.oFeatures.bDeferRender && P(e), r = 0;
                for (i = e.aoColumns.length; r < i; r++) o = d[r].sTitle.replace(/<.*?>/g, ""), s = d[r].nTh, s.removeAttribute("aria-sort"), s.removeAttribute("aria-label"), d[r].bSortable ? 0 < f.length && f[0][0] == r ? (s.setAttribute("aria-sort", "asc" == f[0][1] ? "ascending" : "descending"), s.setAttribute("aria-label", o + ("asc" == (d[r].asSorting[f[0][2] + 1] ? d[r].asSorting[f[0][2] + 1] : d[r].asSorting[0]) ? m.sSortAscending : m.sSortDescending))) : s.setAttribute("aria-label", o + ("asc" == d[r].asSorting[0] ? m.sSortAscending : m.sSortDescending)) : s.setAttribute("aria-label", o);
                e.bSorted = !0, h(e.oInstance).trigger("sort", e), e.oFeatures.bFilter ? K(e, e.oPreviousSearch, 1) : (e.aiDisplay = e.aiDisplayMaster.slice(), e._iDisplayStart = 0, y(e), x(e))
            }

            function ia(e, t, n, r) {
                Ra(t, {}, function (t) {
                    if (!1 !== e.aoColumns[n].bSortable) {
                        var i = function () {
                            var r, i;
                            if (t.shiftKey) {
                                for (var s = !1, o = 0; o < e.aaSorting.length; o++)
                                    if (e.aaSorting[o][0] == n) {
                                        s = !0, r = e.aaSorting[o][0], i = e.aaSorting[o][2] + 1, e.aoColumns[r].asSorting[i] ? (e.aaSorting[o][1] = e.aoColumns[r].asSorting[i], e.aaSorting[o][2] = i) : e.aaSorting.splice(o, 1);
                                        break
                                    }!1 === s && e.aaSorting.push([n, e.aoColumns[n].asSorting[0], 0])
                            } else 1 == e.aaSorting.length && e.aaSorting[0][0] == n ? (r = e.aaSorting[0][0], i = e.aaSorting[0][2] + 1, e.aoColumns[r].asSorting[i] || (i = 0), e.aaSorting[0][1] = e.aoColumns[r].asSorting[i], e.aaSorting[0][2] = i) : (e.aaSorting.splice(0, e.aaSorting.length), e.aaSorting.push([n, e.aoColumns[n].asSorting[0], 0]));
                            O(e)
                        };
                        e.oFeatures.bProcessing ? (E(e, !0), setTimeout(function () {
                            i(), e.oFeatures.bServerSide || E(e, !1)
                        }, 0)) : i(), "function" == typeof r && r(e)
                    }
                })
            }

            function P(e) {
                var t, n, r, i, s, o = e.aoColumns.length,
                    u = e.oClasses;
                for (t = 0; t < o; t++) e.aoColumns[t].bSortable && h(e.aoColumns[t].nTh).removeClass(u.sSortAsc + " " + u.sSortDesc + " " + e.aoColumns[t].sSortingClass);
                n = null !== e.aaSortingFixed ? e.aaSortingFixed.concat(e.aaSorting) : e.aaSorting.slice();
                for (t = 0; t < e.aoColumns.length; t++)
                    if (e.aoColumns[t].bSortable) {
                        s = e.aoColumns[t].sSortingClass, i = -1;
                        for (r = 0; r < n.length; r++)
                            if (n[r][0] == t) {
                                s = "asc" == n[r][1] ? u.sSortAsc : u.sSortDesc, i = r;
                                break
                            }
                        h(e.aoColumns[t].nTh).addClass(s), e.bJUI && (s = h("span." + u.sSortIcon, e.aoColumns[t].nTh), s.removeClass(u.sSortJUIAsc + " " + u.sSortJUIDesc + " " + u.sSortJUI + " " + u.sSortJUIAscAllowed + " " + u.sSortJUIDescAllowed), s.addClass(-1 == i ? e.aoColumns[t].sSortingClassJUI : "asc" == n[i][1] ? u.sSortJUIAsc : u.sSortJUIDesc))
                    } else h(e.aoColumns[t].nTh).addClass(e.aoColumns[t].sSortingClass);
                s = u.sSortColumn;
                if (e.oFeatures.bSort && e.oFeatures.bSortClasses) {
                    e = J(e), i = [];
                    for (t = 0; t < o; t++) i.push("");
                    t = 0;
                    for (r = 1; t < n.length; t++) u = parseInt(n[t][0], 10), i[u] = s + r, 3 > r && r++;
                    s = RegExp(s + "[123]");
                    var a;
                    t = 0;
                    for (n = e.length; t < n; t++) u = t % o, r = e[t].className, a = i[u], u = r.replace(s, a), u != r ? e[t].className = h.trim(u) : 0 < a.length && -1 == r.indexOf(a) && (e[t].className = r + " " + a)
                }
            }

            function ra(e) {
                if (e.oFeatures.bStateSave && !e.bDestroying) {
                    var t, n;
                    t = e.oScroll.bInfinite;
                    var r = {
                        iCreate: (new Date).getTime(),
                        iStart: t ? 0 : e._iDisplayStart,
                        iEnd: t ? e._iDisplayLength : e._iDisplayEnd,
                        iLength: e._iDisplayLength,
                        aaSorting: h.extend(!0, [], e.aaSorting),
                        oSearch: h.extend(!0, {}, e.oPreviousSearch),
                        aoSearchCols: h.extend(!0, [], e.aoPreSearchCols),
                        abVisCols: []
                    };
                    t = 0;
                    for (n = e.aoColumns.length; t < n; t++) r.abVisCols.push(e.aoColumns[t].bVisible);
                    A(e, "aoStateSaveParams", "stateSaveParams", [e, r]), e.fnStateSave.call(e.oInstance, e, r)
                }
            }

            function Sa(e, t) {
                if (e.oFeatures.bStateSave) {
                    var n = e.fnStateLoad.call(e.oInstance, e);
                    if (n) {
                        var r = A(e, "aoStateLoadParams", "stateLoadParams", [e, n]);
                        if (-1 === h.inArray(!1, r)) {
                            e.oLoadedState = h.extend(!0, {}, n), e._iDisplayStart = n.iStart, e.iInitDisplayStart = n.iStart, e._iDisplayEnd = n.iEnd, e._iDisplayLength = n.iLength, e.aaSorting = n.aaSorting.slice(), e.saved_aaSorting = n.aaSorting.slice(), h.extend(e.oPreviousSearch, n.oSearch), h.extend(!0, e.aoPreSearchCols, n.aoSearchCols), t.saved_aoColumns = [];
                            for (r = 0; r < n.abVisCols.length; r++) t.saved_aoColumns[r] = {}, t.saved_aoColumns[r].bVisible = n.abVisCols[r];
                            A(e, "aoStateLoaded", "stateLoaded", [e, n])
                        }
                    }
                }
            }

            function s(e) {
                for (var t = 0; t < j.settings.length; t++)
                    if (j.settings[t].nTable === e) return j.settings[t];
                return null
            }

            function T(e) {
                for (var t = [], e = e.aoData, n = 0, r = e.length; n < r; n++) null !== e[n].nTr && t.push(e[n].nTr);
                return t
            }

            function J(e, t) {
                var r = [],
                    i, s, o, u, a, f;
                s = 0;
                var l = e.aoData.length;
                t !== n && (s = t, l = t + 1);
                for (o = s; o < l; o++)
                    if (f = e.aoData[o], null !== f.nTr) {
                        s = [];
                        for (i = f.nTr.firstChild; i;) u = i.nodeName.toLowerCase(), ("td" == u || "th" == u) && s.push(i), i = i.nextSibling;
                        u = i = 0;
                        for (a = e.aoColumns.length; u < a; u++) e.aoColumns[u].bVisible ? r.push(s[u - i]) : (r.push(f._anHidden[u]), i++)
                    }
                return r
            }

            function D(e, t, n) {
                e = null === e ? "DataTables warning: " + n : "DataTables warning (table id = '" + e.sTableId + "'): " + n;
                if (0 === t) {
                    if ("alert" != j.ext.sErrMode) throw Error(e);
                    alert(e)
                } else X.console && console.log && console.log(e)
            }

            function p(e, t, r, i) {
                i === n && (i = r), t[r] !== n && (e[i] = t[r])
            }

            function Ta(t, n) {
                var r, i;
                for (i in n) n.hasOwnProperty(i) && (r = n[i], "object" == typeof e[i] && null !== r && !1 === h.isArray(r) ? h.extend(!0, t[i], r) : t[i] = r);
                return t
            }

            function Ra(e, t, n) {
                h(e).bind("click.DT", t, function (t) {
                    e.blur(), n(t)
                }).bind("keypress.DT", t, function (e) {
                    13 === e.which && n(e)
                }).bind("selectstart.DT", function () {
                    return !1
                })
            }

            function z(e, t, n, r) {
                n && e[t].push({
                    fn: n,
                    sName: r
                })
            }

            function A(e, t, n, r) {
                for (var t = e[t], i = [], s = t.length - 1; 0 <= s; s--) i.push(t[s].fn.apply(e.oInstance, r));
                return null !== n && h(e.oInstance).trigger(n, r), i
            }

            function Ua(e) {
                var t = h('<div style="position:absolute; top:0; left:0; height:1px; width:1px; overflow:hidden"><div style="position:absolute; top:1px; left:1px; width:100px; overflow:scroll;"><div id="DT_BrowserTest" style="width:100%; height:10px;"></div></div></div>')[0];
                l.body.appendChild(t), e.oBrowser.bScrollOversize = 100 === h("#DT_BrowserTest", t)[0].offsetWidth ? !0 : !1, l.body.removeChild(t)
            }

            function Va(e) {
                return function () {
                    var t = [s(this[j.ext.iApiIndex])].concat(Array.prototype.slice.call(arguments));
                    return j.ext.oApi[e].apply(this, t)
                }
            }
            var U = /\[.*?\]$/,
                Wa = X.JSON ? JSON.stringify : function (e) {
                    var t = typeof e;
                    if ("object" !== t || null === e) return "string" === t && (e = '"' + e + '"'), e + "";
                    var n, r, i = [],
                        s = h.isArray(e);
                    for (n in e) r = e[n], t = typeof r, "string" === t ? r = '"' + r + '"' : "object" === t && null !== r && (r = Wa(r)), i.push((s ? "" : '"' + n + '":') + r);
                    return (s ? "[" : "{") + i + (s ? "]" : "}")
                };
            this.$ = function (e, t) {
                var n, r, i = [],
                    o;
                r = s(this[j.ext.iApiIndex]);
                var u = r.aoData,
                    a = r.aiDisplay,
                    f = r.aiDisplayMaster;
                t || (t = {}), t = h.extend({}, {
                    filter: "none",
                    order: "current",
                    page: "all"
                }, t);
                if ("current" == t.page) {
                    n = r._iDisplayStart;
                    for (r = r.fnDisplayEnd(); n < r; n++)(o = u[a[n]].nTr) && i.push(o)
                } else if ("current" == t.order && "none" == t.filter) {
                    n = 0;
                    for (r = f.length; n < r; n++)(o = u[f[n]].nTr) && i.push(o)
                } else if ("current" == t.order && "applied" == t.filter) {
                    n = 0;
                    for (r = a.length; n < r; n++)(o = u[a[n]].nTr) && i.push(o)
                } else if ("original" == t.order && "none" == t.filter) {
                    n = 0;
                    for (r = u.length; n < r; n++)(o = u[n].nTr) && i.push(o)
                } else if ("original" == t.order && "applied" == t.filter) {
                    n = 0;
                    for (r = u.length; n < r; n++) o = u[n].nTr, -1 !== h.inArray(n, a) && o && i.push(o)
                } else D(r, 1, "Unknown selection options");
                return i = h(i), n = i.filter(e), i = i.find(e), h([].concat(h.makeArray(n), h.makeArray(i)))
            }, this._ = function (e, t) {
                var n = [],
                    r, i, s = this.$(e, t);
                r = 0;
                for (i = s.length; r < i; r++) n.push(this.fnGetData(s[r]));
                return n
            }, this.fnAddData = function (e, t) {
                if (0 === e.length) return [];
                var r = [],
                    i, o = s(this[j.ext.iApiIndex]);
                if ("object" == typeof e[0] && null !== e[0])
                    for (var u = 0; u < e.length; u++) {
                        i = H(o, e[u]);
                        if (-1 == i) return r;
                        r.push(i)
                    } else {
                        i = H(o, e);
                        if (-1 == i) return r;
                        r.push(i)
                    }
                return o.aiDisplay = o.aiDisplayMaster.slice(), (t === n || t) && aa(o), r
            }, this.fnAdjustColumnSizing = function (e) {
                var t = s(this[j.ext.iApiIndex]);
                k(t), e === n || e ? this.fnDraw(!1) : ("" !== t.oScroll.sX || "" !== t.oScroll.sY) && this.oApi._fnScrollDraw(t)
            }, this.fnClearTable = function (e) {
                var t = s(this[j.ext.iApiIndex]);
                ga(t), (e === n || e) && x(t)
            }, this.fnClose = function (e) {
                for (var t = s(this[j.ext.iApiIndex]), n = 0; n < t.aoOpenRows.length; n++)
                    if (t.aoOpenRows[n].nParent == e) return (e = t.aoOpenRows[n].nTr.parentNode) && e.removeChild(t.aoOpenRows[n].nTr), t.aoOpenRows.splice(n, 1), 0;
                return 1
            }, this.fnDeleteRow = function (e, t, r) {
                var i = s(this[j.ext.iApiIndex]),
                    o, u, e = "object" == typeof e ? I(i, e) : e,
                    a = i.aoData.splice(e, 1);
                o = 0;
                for (u = i.aoData.length; o < u; o++) null !== i.aoData[o].nTr && (i.aoData[o].nTr._DT_RowIndex = o);
                o = h.inArray(e, i.aiDisplay), i.asDataSearch.splice(o, 1), ha(i.aiDisplayMaster, e), ha(i.aiDisplay, e), "function" == typeof t && t.call(this, i, a), i._iDisplayStart >= i.fnRecordsDisplay() && (i._iDisplayStart -= i._iDisplayLength, 0 > i._iDisplayStart && (i._iDisplayStart = 0));
                if (r === n || r) y(i), x(i);
                return a
            }, this.fnDestroy = function (t) {
                var r = s(this[j.ext.iApiIndex]),
                    i = r.nTableWrapper.parentNode,
                    o = r.nTBody,
                    u, a, t = t === n ? !1 : t;
                r.bDestroying = !0, A(r, "aoDestroyCallback", "destroy", [r]);
                if (!t) {
                    u = 0;
                    for (a = r.aoColumns.length; u < a; u++)!1 === r.aoColumns[u].bVisible && this.fnSetColumnVis(u, !0)
                }
                h(r.nTableWrapper).find("*").andSelf().unbind(".DT"), h("tbody>tr>td." + r.oClasses.sRowEmpty, r.nTable).parent().remove(), r.nTable != r.nTHead.parentNode && (h(r.nTable).children("thead").remove(), r.nTable.appendChild(r.nTHead)), r.nTFoot && r.nTable != r.nTFoot.parentNode && (h(r.nTable).children("tfoot").remove(), r.nTable.appendChild(r.nTFoot)), r.nTable.parentNode.removeChild(r.nTable), h(r.nTableWrapper).remove(), r.aaSorting = [], r.aaSortingFixed = [], P(r), h(T(r)).removeClass(r.asStripeClasses.join(" ")), h("th, td", r.nTHead).removeClass([r.oClasses.sSortable, r.oClasses.sSortableAsc, r.oClasses.sSortableDesc, r.oClasses.sSortableNone].join(" ")), r.bJUI && (h("th span." + r.oClasses.sSortIcon + ", td span." + r.oClasses.sSortIcon, r.nTHead).remove(), h("th, td", r.nTHead).each(function () {
                    var e = h("div." + r.oClasses.sSortJUIWrapper, this),
                        t = e.contents();
                    h(this).append(t), e.remove()
                })), !t && r.nTableReinsertBefore ? i.insertBefore(r.nTable, r.nTableReinsertBefore) : t || i.appendChild(r.nTable), u = 0;
                for (a = r.aoData.length; u < a; u++) null !== r.aoData[u].nTr && o.appendChild(r.aoData[u].nTr);
                !0 === r.oFeatures.bAutoWidth && (r.nTable.style.width = q(r.sDestroyWidth));
                if (a = r.asDestroyStripes.length) {
                    t = h(o).children("tr");
                    for (u = 0; u < a; u++) t.filter(":nth-child(" + a + "n + " + u + ")").addClass(r.asDestroyStripes[u])
                }
                u = 0;
                for (a = j.settings.length; u < a; u++) j.settings[u] == r && j.settings.splice(u, 1);
                e = r = null
            }, this.fnDraw = function (e) {
                var t = s(this[j.ext.iApiIndex]);
                !1 === e ? (y(t), x(t)) : aa(t)
            }, this.fnFilter = function (e, t, r, i, o, u) {
                var a = s(this[j.ext.iApiIndex]);
                if (a.oFeatures.bFilter) {
                    if (r === n || null === r) r = !1;
                    if (i === n || null === i) i = !0;
                    if (o === n || null === o) o = !0;
                    if (u === n || null === u) u = !0;
                    if (t === n || null === t) {
                        if (K(a, {
                            sSearch: e + "",
                            bRegex: r,
                            bSmart: i,
                            bCaseInsensitive: u
                        }, 1), o && a.aanFeatures.f) {
                            t = a.aanFeatures.f, r = 0;
                            for (i = t.length; r < i; r++) try {
                                t[r]._DT_Input != l.activeElement && h(t[r]._DT_Input).val(e)
                            } catch (f) {
                                h(t[r]._DT_Input).val(e)
                            }
                        }
                    } else h.extend(a.aoPreSearchCols[t], {
                        sSearch: e + "",
                        bRegex: r,
                        bSmart: i,
                        bCaseInsensitive: u
                    }), K(a, a.oPreviousSearch, 1)
                }
            }, this.fnGetData = function (e, t) {
                var r = s(this[j.ext.iApiIndex]);
                if (e !== n) {
                    var i = e;
                    if ("object" == typeof e) {
                        var o = e.nodeName.toLowerCase();
                        "tr" === o ? i = I(r, e) : "td" === o && (i = I(r, e.parentNode), t = fa(r, i, e))
                    }
                    return t !== n ? v(r, i, t, "") : r.aoData[i] !== n ? r.aoData[i]._aData : null
                }
                return Z(r)
            }, this.fnGetNodes = function (e) {
                var t = s(this[j.ext.iApiIndex]);
                return e !== n ? t.aoData[e] !== n ? t.aoData[e].nTr : null : T(t)
            }, this.fnGetPosition = function (e) {
                var t = s(this[j.ext.iApiIndex]),
                    n = e.nodeName.toUpperCase();
                return "TR" == n ? I(t, e) : "TD" == n || "TH" == n ? (n = I(t, e.parentNode), e = fa(t, n, e), [n, R(t, e), e]) : null
            }, this.fnIsOpen = function (e) {
                for (var t = s(this[j.ext.iApiIndex]), n = 0; n < t.aoOpenRows.length; n++)
                    if (t.aoOpenRows[n].nParent == e) return !0;
                return !1
            }, this.fnOpen = function (e, n, r) {
                var i = s(this[j.ext.iApiIndex]),
                    o = T(i);
                if (-1 !== h.inArray(e, o)) {
                    this.fnClose(e);
                    var o = l.createElement("tr"),
                        u = l.createElement("td");
                    return o.appendChild(u), u.className = r, u.colSpan = t(i), "string" == typeof n ? u.innerHTML = n : h(u).html(n), n = h("tr", i.nTBody), -1 != h.inArray(e, n) && h(o).insertAfter(e), i.aoOpenRows.push({
                        nTr: o,
                        nParent: e
                    }), o
                }
            }, this.fnPageChange = function (e, t) {
                var r = s(this[j.ext.iApiIndex]);
                qa(r, e), y(r), (t === n || t) && x(r)
            }, this.fnSetColumnVis = function (e, r, i) {
                var o = s(this[j.ext.iApiIndex]),
                    u, a, f = o.aoColumns,
                    l = o.aoData,
                    c, h;
                if (f[e].bVisible != r) {
                    if (r) {
                        for (u = a = 0; u < e; u++) f[u].bVisible && a++;
                        h = a >= t(o);
                        if (!h)
                            for (u = e; u < f.length; u++)
                                if (f[u].bVisible) {
                                    c = u;
                                    break
                                }
                        u = 0;
                        for (a = l.length; u < a; u++) null !== l[u].nTr && (h ? l[u].nTr.appendChild(l[u]._anHidden[e]) : l[u].nTr.insertBefore(l[u]._anHidden[e], J(o, u)[c]))
                    } else {
                        u = 0;
                        for (a = l.length; u < a; u++) null !== l[u].nTr && (c = J(o, u)[e], l[u]._anHidden[e] = c, c.parentNode.removeChild(c))
                    }
                    f[e].bVisible = r, W(o, o.aoHeader), o.nTFoot && W(o, o.aoFooter), u = 0;
                    for (a = o.aoOpenRows.length; u < a; u++) o.aoOpenRows[u].nTr.colSpan = t(o);
                    if (i === n || i) k(o), x(o);
                    ra(o)
                }
            }, this.fnSettings = function () {
                return s(this[j.ext.iApiIndex])
            }, this.fnSort = function (e) {
                var t = s(this[j.ext.iApiIndex]);
                t.aaSorting = e, O(t)
            }, this.fnSortListener = function (e, t, n) {
                ia(s(this[j.ext.iApiIndex]), e, t, n)
            }, this.fnUpdate = function (e, t, i, o, u) {
                var a = s(this[j.ext.iApiIndex]),
                    t = "object" == typeof t ? I(a, t) : t;
                if (h.isArray(e) && i === n) {
                    a.aoData[t]._aData = e.slice();
                    for (i = 0; i < a.aoColumns.length; i++) this.fnUpdate(v(a, t, i), t, i, !1, !1)
                } else if (h.isPlainObject(e) && i === n) {
                    a.aoData[t]._aData = h.extend(!0, {}, e);
                    for (i = 0; i < a.aoColumns.length; i++) this.fnUpdate(v(a, t, i), t, i, !1, !1)
                } else {
                    F(a, t, i, e);
                    var e = v(a, t, i, "display"),
                        f = a.aoColumns[i];
                    null !== f.fnRender && (e = S(a, t, i), f.bUseRendered && F(a, t, i, e)), null !== a.aoData[t].nTr && (J(a, t)[i].innerHTML = e)
                }
                return i = h.inArray(t, a.aiDisplay), a.asDataSearch[i] = na(a, Y(a, t, "filter", r(a, "bSearchable"))), (u === n || u) && k(a), (o === n || o) && aa(a), 0
            }, this.fnVersionCheck = j.ext.fnVersionCheck, this.oApi = {
                _fnExternApiFunc: Va,
                _fnInitialise: ba,
                _fnInitComplete: $,
                _fnLanguageCompat: pa,
                _fnAddColumn: o,
                _fnColumnOptions: m,
                _fnAddData: H,
                _fnCreateTr: ea,
                _fnGatherData: ua,
                _fnBuildHead: va,
                _fnDrawHead: W,
                _fnDraw: x,
                _fnReDraw: aa,
                _fnAjaxUpdate: wa,
                _fnAjaxParameters: Ea,
                _fnAjaxUpdateDraw: Fa,
                _fnServerParams: ka,
                _fnAddOptionsHtml: xa,
                _fnFeatureHtmlTable: Ba,
                _fnScrollDraw: La,
                _fnAdjustColumnSizing: k,
                _fnFeatureHtmlFilter: za,
                _fnFilterComplete: K,
                _fnFilterCustom: Ia,
                _fnFilterColumn: Ha,
                _fnFilter: Ga,
                _fnBuildSearchArray: la,
                _fnBuildSearchRow: na,
                _fnFilterCreateSearch: ma,
                _fnDataToSearch: Ja,
                _fnSort: O,
                _fnSortAttachListener: ia,
                _fnSortingClasses: P,
                _fnFeatureHtmlPaginate: Da,
                _fnPageChange: qa,
                _fnFeatureHtmlInfo: Ca,
                _fnUpdateInfo: Ka,
                _fnFeatureHtmlLength: ya,
                _fnFeatureHtmlProcessing: Aa,
                _fnProcessingDisplay: E,
                _fnVisibleToColumnIndex: G,
                _fnColumnIndexToVisible: R,
                _fnNodeToDataIndex: I,
                _fnVisbleColumns: t,
                _fnCalculateEnd: y,
                _fnConvertToWidth: Ma,
                _fnCalculateColumnWidths: da,
                _fnScrollingWidthAdjust: Oa,
                _fnGetWidestNode: Na,
                _fnGetMaxLenString: Pa,
                _fnStringToCss: q,
                _fnDetectType: B,
                _fnSettingsFromNode: s,
                _fnGetDataMaster: Z,
                _fnGetTrNodes: T,
                _fnGetTdNodes: J,
                _fnEscapeRegex: oa,
                _fnDeleteIndex: ha,
                _fnReOrderIndex: u,
                _fnColumnOrdering: M,
                _fnLog: D,
                _fnClearTable: ga,
                _fnSaveState: ra,
                _fnLoadState: Sa,
                _fnCreateCookie: function (a, b, c, d, e) {
                    var f = new Date;
                    f.setTime(f.getTime() + 1e3 * c);
                    var c = X.location.pathname.split("http://beer2code.com/"),
                        a = a + "_" + c.pop().replace(/[\/:]/g, "").toLowerCase(),
                        g;
                    null !== e ? (g = "function" == typeof h.parseJSON ? h.parseJSON(b) : eval("(" + b + ")"), b = e(a, g, f.toGMTString(), c.join("http://beer2code.com/") + "/")) : b = a + "=" + encodeURIComponent(b) + "; expires=" + f.toGMTString() + "; path=" + c.join("http://beer2code.com/") + "/", a = l.cookie.split(";"), e = b.split(";")[0].length, f = [];
                    if (4096 < e + l.cookie.length + 10) {
                        for (var j = 0, o = a.length; j < o; j++)
                            if (-1 != a[j].indexOf(d)) {
                                var k = a[j].split("=");
                                try {
                                    (g = eval("(" + decodeURIComponent(k[1]) + ")")) && g.iCreate && f.push({
                                        name: k[0],
                                        time: g.iCreate
                                    })
                                } catch (m) {}
                            }
                        for (f.sort(function (e, t) {
                            return t.time - e.time
                        }); 4096 < e + l.cookie.length + 10;) {
                            if (0 === f.length) return;
                            d = f.pop(), l.cookie = d.name + "=; expires=Thu, 01-Jan-1970 00:00:01 GMT; path=" + c.join("http://beer2code.com/") + "/"
                        }
                    }
                    l.cookie = b
                },
                _fnReadCookie: function (e) {
                    for (var t = X.location.pathname.split("http://beer2code.com/"), e = e + "_" + t[t.length - 1].replace(/[\/:]/g, "").toLowerCase() + "=", t = l.cookie.split(";"), n = 0; n < t.length; n++) {
                        for (var r = t[n];
                            " " == r.charAt(0);) r = r.substring(1, r.length);
                        if (0 === r.indexOf(e)) return decodeURIComponent(r.substring(e.length, r.length))
                    }
                    return null
                },
                _fnDetectHeader: V,
                _fnGetUniqueThs: N,
                _fnScrollBarWidth: Qa,
                _fnApplyToChildren: C,
                _fnMap: p,
                _fnGetRowData: Y,
                _fnGetCellData: v,
                _fnSetCellData: F,
                _fnGetObjectDataFn: Q,
                _fnSetObjectDataFn: L,
                _fnApplyColumnDefs: ta,
                _fnBindAction: Ra,
                _fnExtend: Ta,
                _fnCallbackReg: z,
                _fnCallbackFire: A,
                _fnJsonString: Wa,
                _fnRender: S,
                _fnNodeToColumnIndex: fa,
                _fnInfoMacros: ja,
                _fnBrowserDetect: Ua,
                _fnGetColumns: r
            }, h.extend(j.ext.oApi, this.oApi);
            for (var sa in j.ext.oApi) sa && (this[sa] = Va(sa));
            var ca = this;
            return this.each(function () {
                var t = 0,
                    r, i, s;
                i = this.getAttribute("id");
                var u = !1,
                    a = !1;
                if ("table" != this.nodeName.toLowerCase()) D(null, 0, "Attempted to initialise DataTables on a node which is not a table: " + this.nodeName);
                else {
                    t = 0;
                    for (r = j.settings.length; t < r; t++) {
                        if (j.settings[t].nTable == this) {
                            if (e === n || e.bRetrieve) return j.settings[t].oInstance;
                            if (e.bDestroy) {
                                j.settings[t].oInstance.fnDestroy();
                                break
                            }
                            D(j.settings[t], 0, "Cannot reinitialise DataTable.\n\nTo retrieve the DataTables object for this table, pass no arguments or see the docs for bRetrieve and bDestroy");
                            return
                        }
                        if (j.settings[t].sTableId == this.id) {
                            j.settings.splice(t, 1);
                            break
                        }
                    }
                    if (null === i || "" === i) this.id = i = "DataTables_Table_" + j.ext._oExternConfig.iNextUnique++;
                    var f = h.extend(!0, {}, j.models.oSettings, {
                        nTable: this,
                        oApi: ca.oApi,
                        oInit: e,
                        sDestroyWidth: h(this).width(),
                        sInstance: i,
                        sTableId: i
                    });
                    j.settings.push(f), f.oInstance = 1 === ca.length ? ca : h(this).dataTable(), e || (e = {}), e.oLanguage && pa(e.oLanguage), e = Ta(h.extend(!0, {}, j.defaults), e), p(f.oFeatures, e, "bPaginate"), p(f.oFeatures, e, "bLengthChange"), p(f.oFeatures, e, "bFilter"), p(f.oFeatures, e, "bSort"), p(f.oFeatures, e, "bInfo"), p(f.oFeatures, e, "bProcessing"), p(f.oFeatures, e, "bAutoWidth"), p(f.oFeatures, e, "bSortClasses"), p(f.oFeatures, e, "bServerSide"), p(f.oFeatures, e, "bDeferRender"), p(f.oScroll, e, "sScrollX", "sX"), p(f.oScroll, e, "sScrollXInner", "sXInner"), p(f.oScroll, e, "sScrollY", "sY"), p(f.oScroll, e, "bScrollCollapse", "bCollapse"), p(f.oScroll, e, "bScrollInfinite", "bInfinite"), p(f.oScroll, e, "iScrollLoadGap", "iLoadGap"), p(f.oScroll, e, "bScrollAutoCss", "bAutoCss"), p(f, e, "asStripeClasses"), p(f, e, "asStripClasses", "asStripeClasses"), p(f, e, "fnServerData"), p(f, e, "fnFormatNumber"), p(f, e, "sServerMethod"), p(f, e, "aaSorting"), p(f, e, "aaSortingFixed"), p(f, e, "aLengthMenu"), p(f, e, "sPaginationType"), p(f, e, "sAjaxSource"), p(f, e, "sAjaxDataProp"), p(f, e, "iCookieDuration"), p(f, e, "sCookiePrefix"), p(f, e, "sDom"), p(f, e, "bSortCellsTop"), p(f, e, "iTabIndex"), p(f, e, "oSearch", "oPreviousSearch"), p(f, e, "aoSearchCols", "aoPreSearchCols"), p(f, e, "iDisplayLength", "_iDisplayLength"), p(f, e, "bJQueryUI", "bJUI"), p(f, e, "fnCookieCallback"), p(f, e, "fnStateLoad"), p(f, e, "fnStateSave"), p(f.oLanguage, e, "fnInfoCallback"), z(f, "aoDrawCallback", e.fnDrawCallback, "user"), z(f, "aoServerParams", e.fnServerParams, "user"), z(f, "aoStateSaveParams", e.fnStateSaveParams, "user"), z(f, "aoStateLoadParams", e.fnStateLoadParams, "user"), z(f, "aoStateLoaded", e.fnStateLoaded, "user"), z(f, "aoRowCallback", e.fnRowCallback, "user"), z(f, "aoRowCreatedCallback", e.fnCreatedRow, "user"), z(f, "aoHeaderCallback", e.fnHeaderCallback, "user"), z(f, "aoFooterCallback", e.fnFooterCallback, "user"), z(f, "aoInitComplete", e.fnInitComplete, "user"), z(f, "aoPreDrawCallback", e.fnPreDrawCallback, "user"), f.oFeatures.bServerSide && f.oFeatures.bSort && f.oFeatures.bSortClasses ? z(f, "aoDrawCallback", P, "server_side_sort_classes") : f.oFeatures.bDeferRender && z(f, "aoDrawCallback", P, "defer_sort_classes"), e.bJQueryUI ? (h.extend(f.oClasses, j.ext.oJUIClasses), e.sDom === j.defaults.sDom && "lfrtip" === j.defaults.sDom && (f.sDom = '<"H"lfr>t<"F"ip>')) : h.extend(f.oClasses, j.ext.oStdClasses), h(this).addClass(f.oClasses.sTable);
                    if ("" !== f.oScroll.sX || "" !== f.oScroll.sY) f.oScroll.iBarWidth = Qa();
                    f.iInitDisplayStart === n && (f.iInitDisplayStart = e.iDisplayStart, f._iDisplayStart = e.iDisplayStart), e.bStateSave && (f.oFeatures.bStateSave = !0, Sa(f, e), z(f, "aoDrawCallback", ra, "state_save")), null !== e.iDeferLoading && (f.bDeferLoading = !0, t = h.isArray(e.iDeferLoading), f._iRecordsDisplay = t ? e.iDeferLoading[0] : e.iDeferLoading, f._iRecordsTotal = t ? e.iDeferLoading[1] : e.iDeferLoading), null !== e.aaData && (a = !0), "" !== e.oLanguage.sUrl ? (f.oLanguage.sUrl = e.oLanguage.sUrl, h.getJSON(f.oLanguage.sUrl, null, function (t) {
                        pa(t), h.extend(!0, f.oLanguage, e.oLanguage, t), ba(f)
                    }), u = !0) : h.extend(!0, f.oLanguage, e.oLanguage), null === e.asStripeClasses && (f.asStripeClasses = [f.oClasses.sStripeOdd, f.oClasses.sStripeEven]), r = f.asStripeClasses.length, f.asDestroyStripes = [];
                    if (r) {
                        i = !1, s = h(this).children("tbody").children("tr:lt(" + r + ")");
                        for (t = 0; t < r; t++) s.hasClass(f.asStripeClasses[t]) && (i = !0, f.asDestroyStripes.push(f.asStripeClasses[t]));
                        i && s.removeClass(f.asStripeClasses.join(" "))
                    }
                    i = [], t = this.getElementsByTagName("thead"), 0 !== t.length && (V(f.aoHeader, t[0]), i = N(f));
                    if (null === e.aoColumns) {
                        s = [], t = 0;
                        for (r = i.length; t < r; t++) s.push(null)
                    } else s = e.aoColumns;
                    t = 0;
                    for (r = s.length; t < r; t++) e.saved_aoColumns !== n && e.saved_aoColumns.length == r && (null === s[t] && (s[t] = {}), s[t].bVisible = e.saved_aoColumns[t].bVisible), o(f, i ? i[t] : null);
                    ta(f, e.aoColumnDefs, s, function (e, t) {
                        m(f, e, t)
                    }), t = 0;
                    for (r = f.aaSorting.length; t < r; t++) {
                        f.aaSorting[t][0] >= f.aoColumns.length && (f.aaSorting[t][0] = 0);
                        var c = f.aoColumns[f.aaSorting[t][0]];
                        f.aaSorting[t][2] === n && (f.aaSorting[t][2] = 0), e.aaSorting === n && f.saved_aaSorting === n && (f.aaSorting[t][1] = c.asSorting[0]), i = 0;
                        for (s = c.asSorting.length; i < s; i++)
                            if (f.aaSorting[t][1] == c.asSorting[i]) {
                                f.aaSorting[t][2] = i;
                                break
                            }
                    }
                    P(f), Ua(f), t = h(this).children("caption").each(function () {
                        this._captionSide = h(this).css("caption-side")
                    }), r = h(this).children("thead"), 0 === r.length && (r = [l.createElement("thead")], this.appendChild(r[0])), f.nTHead = r[0], r = h(this).children("tbody"), 0 === r.length && (r = [l.createElement("tbody")], this.appendChild(r[0])), f.nTBody = r[0], f.nTBody.setAttribute("role", "alert"), f.nTBody.setAttribute("aria-live", "polite"), f.nTBody.setAttribute("aria-relevant", "all"), r = h(this).children("tfoot"), 0 === r.length && 0 < t.length && ("" !== f.oScroll.sX || "" !== f.oScroll.sY) && (r = [l.createElement("tfoot")], this.appendChild(r[0])), 0 < r.length && (f.nTFoot = r[0], V(f.aoFooter, f.nTFoot));
                    if (a)
                        for (t = 0; t < e.aaData.length; t++) H(f, e.aaData[t]);
                    else ua(f);
                    f.aiDisplay = f.aiDisplayMaster.slice(), f.bInitialised = !0, !1 === u && ba(f)
                }
            }), ca = null, this
        };
        j.fnVersionCheck = function (e) {
            for (var t = function (e, t) {
                for (; e.length < t;) e += "0";
                return e
            }, n = j.ext.sVersion.split("."), e = e.split("."), r = "", i = "", s = 0, o = e.length; s < o; s++) r += t(n[s], 3), i += t(e[s], 3);
            return parseInt(r, 10) >= parseInt(i, 10)
        }, j.fnIsDataTable = function (e) {
            for (var t = j.settings, n = 0; n < t.length; n++)
                if (t[n].nTable === e || t[n].nScrollHead === e || t[n].nScrollFoot === e) return !0;
            return !1
        }, j.fnTables = function (e) {
            var t = [];
            return jQuery.each(j.settings, function (n, r) {
                (!e || !0 === e && h(r.nTable).is(":visible")) && t.push(r.nTable)
            }), t
        }, j.version = "1.9.4", j.settings = [], j.models = {}, j.models.ext = {
            afnFiltering: [],
            afnSortData: [],
            aoFeatures: [],
            aTypes: [],
            fnVersionCheck: j.fnVersionCheck,
            iApiIndex: 0,
            ofnSearch: {},
            oApi: {},
            oStdClasses: {},
            oJUIClasses: {},
            oPagination: {},
            oSort: {},
            sVersion: j.version,
            sErrMode: "alert",
            _oExternConfig: {
                iNextUnique: 0
            }
        }, j.models.oSearch = {
            bCaseInsensitive: !0,
            sSearch: "",
            bRegex: !1,
            bSmart: !0
        }, j.models.oRow = {
            nTr: null,
            _aData: [],
            _aSortData: [],
            _anHidden: [],
            _sRowStripe: ""
        }, j.models.oColumn = {
            aDataSort: null,
            asSorting: null,
            bSearchable: null,
            bSortable: null,
            bUseRendered: null,
            bVisible: null,
            _bAutoType: !0,
            fnCreatedCell: null,
            fnGetData: null,
            fnRender: null,
            fnSetData: null,
            mData: null,
            mRender: null,
            nTh: null,
            nTf: null,
            sClass: null,
            sContentPadding: null,
            sDefaultContent: null,
            sName: null,
            sSortDataType: "std",
            sSortingClass: null,
            sSortingClassJUI: null,
            sTitle: null,
            sType: null,
            sWidth: null,
            sWidthOrig: null
        }, j.defaults = {
            aaData: null,
            aaSorting: [
                [0, "asc"]
            ],
            aaSortingFixed: null,
            aLengthMenu: [10, 25, 50, 100],
            aoColumns: null,
            aoColumnDefs: null,
            aoSearchCols: [],
            asStripeClasses: null,
            bAutoWidth: !0,
            bDeferRender: !1,
            bDestroy: !1,
            bFilter: !0,
            bInfo: !0,
            bJQueryUI: !1,
            bLengthChange: !0,
            bPaginate: !0,
            bProcessing: !1,
            bRetrieve: !1,
            bScrollAutoCss: !0,
            bScrollCollapse: !1,
            bScrollInfinite: !1,
            bServerSide: !1,
            bSort: !0,
            bSortCellsTop: !1,
            bSortClasses: !0,
            bStateSave: !1,
            fnCookieCallback: null,
            fnCreatedRow: null,
            fnDrawCallback: null,
            fnFooterCallback: null,
            fnFormatNumber: function (e) {
                if (1e3 > e) return e;
                for (var t = e + "", e = t.split(""), n = "", t = t.length, r = 0; r < t; r++) 0 === r % 3 && 0 !== r && (n = this.oLanguage.sInfoThousands + n), n = e[t - r - 1] + n;
                return n
            },
            fnHeaderCallback: null,
            fnInfoCallback: null,
            fnInitComplete: null,
            fnPreDrawCallback: null,
            fnRowCallback: null,
            fnServerData: function (e, t, n, r) {
                r.jqXHR = h.ajax({
                    url: e,
                    data: t,
                    success: function (e) {
                        e.sError && r.oApi._fnLog(r, 0, e.sError), h(r.oInstance).trigger("xhr", [r, e]), n(e)
                    },
                    dataType: "json",
                    cache: !1,
                    type: r.sServerMethod,
                    error: function (e, t) {
                        "parsererror" == t && r.oApi._fnLog(r, 0, "DataTables warning: JSON data from server could not be parsed. This is caused by a JSON formatting error.")
                    }
                })
            },
            fnServerParams: null,
            fnStateLoad: function (e) {
                var e = this.oApi._fnReadCookie(e.sCookiePrefix + e.sInstance),
                    j;
                try {
                    j = "function" == typeof h.parseJSON ? h.parseJSON(e) : eval("(" + e + ")")
                } catch (m) {
                    j = null
                }
                return j
            },
            fnStateLoadParams: null,
            fnStateLoaded: null,
            fnStateSave: function (e, t) {
                this.oApi._fnCreateCookie(e.sCookiePrefix + e.sInstance, this.oApi._fnJsonString(t), e.iCookieDuration, e.sCookiePrefix, e.fnCookieCallback)
            },
            fnStateSaveParams: null,
            iCookieDuration: 7200,
            iDeferLoading: null,
            iDisplayLength: 10,
            iDisplayStart: 0,
            iScrollLoadGap: 100,
            iTabIndex: 0,
            oLanguage: {
                oAria: {
                    sSortAscending: ": activate to sort column ascending",
                    sSortDescending: ": activate to sort column descending"
                },
                oPaginate: {
                    sFirst: "First",
                    sLast: "Last",
                    sNext: "Next",
                    sPrevious: "Previous"
                },
                sEmptyTable: "No data available in table",
                sInfo: "Showing _START_ to _END_ of _TOTAL_ entries",
                sInfoEmpty: "Showing 0 to 0 of 0 entries",
                sInfoFiltered: "(filtered from _MAX_ total entries)",
                sInfoPostFix: "",
                sInfoThousands: ",",
                sLengthMenu: "Show _MENU_ entries",
                sLoadingRecords: "Loading...",
                sProcessing: "Processing...",
                sSearch: "Search:",
                sUrl: "",
                sZeroRecords: "No matching records found"
            },
            oSearch: h.extend({}, j.models.oSearch),
            sAjaxDataProp: "aaData",
            sAjaxSource: null,
            sCookiePrefix: "SpryMedia_DataTables_",
            sDom: "lfrtip",
            sPaginationType: "two_button",
            sScrollX: "",
            sScrollXInner: "",
            sScrollY: "",
            sServerMethod: "GET"
        }, j.defaults.columns = {
            aDataSort: null,
            asSorting: ["asc", "desc"],
            bSearchable: !0,
            bSortable: !0,
            bUseRendered: !0,
            bVisible: !0,
            fnCreatedCell: null,
            fnRender: null,
            iDataSort: -1,
            mData: null,
            mRender: null,
            sCellType: "td",
            sClass: "",
            sContentPadding: "",
            sDefaultContent: null,
            sName: "",
            sSortDataType: "std",
            sTitle: null,
            sType: null,
            sWidth: null
        }, j.models.oSettings = {
            oFeatures: {
                bAutoWidth: null,
                bDeferRender: null,
                bFilter: null,
                bInfo: null,
                bLengthChange: null,
                bPaginate: null,
                bProcessing: null,
                bServerSide: null,
                bSort: null,
                bSortClasses: null,
                bStateSave: null
            },
            oScroll: {
                bAutoCss: null,
                bCollapse: null,
                bInfinite: null,
                iBarWidth: 0,
                iLoadGap: null,
                sX: null,
                sXInner: null,
                sY: null
            },
            oLanguage: {
                fnInfoCallback: null
            },
            oBrowser: {
                bScrollOversize: !1
            },
            aanFeatures: [],
            aoData: [],
            aiDisplay: [],
            aiDisplayMaster: [],
            aoColumns: [],
            aoHeader: [],
            aoFooter: [],
            asDataSearch: [],
            oPreviousSearch: {},
            aoPreSearchCols: [],
            aaSorting: null,
            aaSortingFixed: null,
            asStripeClasses: null,
            asDestroyStripes: [],
            sDestroyWidth: 0,
            aoRowCallback: [],
            aoHeaderCallback: [],
            aoFooterCallback: [],
            aoDrawCallback: [],
            aoRowCreatedCallback: [],
            aoPreDrawCallback: [],
            aoInitComplete: [],
            aoStateSaveParams: [],
            aoStateLoadParams: [],
            aoStateLoaded: [],
            sTableId: "",
            nTable: null,
            nTHead: null,
            nTFoot: null,
            nTBody: null,
            nTableWrapper: null,
            bDeferLoading: !1,
            bInitialised: !1,
            aoOpenRows: [],
            sDom: null,
            sPaginationType: "two_button",
            iCookieDuration: 0,
            sCookiePrefix: "",
            fnCookieCallback: null,
            aoStateSave: [],
            aoStateLoad: [],
            oLoadedState: null,
            sAjaxSource: null,
            sAjaxDataProp: null,
            bAjaxDataGet: !0,
            jqXHR: null,
            fnServerData: null,
            aoServerParams: [],
            sServerMethod: null,
            fnFormatNumber: null,
            aLengthMenu: null,
            iDraw: 0,
            bDrawing: !1,
            iDrawError: -1,
            _iDisplayLength: 10,
            _iDisplayStart: 0,
            _iDisplayEnd: 10,
            _iRecordsTotal: 0,
            _iRecordsDisplay: 0,
            bJUI: null,
            oClasses: {},
            bFiltered: !1,
            bSorted: !1,
            bSortCellsTop: null,
            oInit: null,
            aoDestroyCallback: [],
            fnRecordsTotal: function () {
                return this.oFeatures.bServerSide ? parseInt(this._iRecordsTotal, 10) : this.aiDisplayMaster.length
            },
            fnRecordsDisplay: function () {
                return this.oFeatures.bServerSide ? parseInt(this._iRecordsDisplay, 10) : this.aiDisplay.length
            },
            fnDisplayEnd: function () {
                return this.oFeatures.bServerSide ? !1 === this.oFeatures.bPaginate || -1 == this._iDisplayLength ? this._iDisplayStart + this.aiDisplay.length : Math.min(this._iDisplayStart + this._iDisplayLength, this._iRecordsDisplay) : this._iDisplayEnd
            },
            oInstance: null,
            sInstance: null,
            iTabIndex: 0,
            nScrollHead: null,
            nScrollFoot: null
        }, j.ext = h.extend(!0, {}, j.models.ext), h.extend(j.ext.oStdClasses, {
            sTable: "dataTable",
            sPagePrevEnabled: "paginate_enabled_previous",
            sPagePrevDisabled: "paginate_disabled_previous",
            sPageNextEnabled: "paginate_enabled_next",
            sPageNextDisabled: "paginate_disabled_next",
            sPageJUINext: "",
            sPageJUIPrev: "",
            sPageButton: "paginate_button",
            sPageButtonActive: "paginate_active",
            sPageButtonStaticDisabled: "paginate_button paginate_button_disabled",
            sPageFirst: "first",
            sPagePrevious: "previous",
            sPageNext: "next",
            sPageLast: "last",
            sStripeOdd: "odd",
            sStripeEven: "even",
            sRowEmpty: "dataTables_empty",
            sWrapper: "dataTables_wrapper",
            sFilter: "dataTables_filter",
            sInfo: "dataTables_info",
            sPaging: "dataTables_paginate paging_",
            sLength: "dataTables_length",
            sProcessing: "dataTables_processing",
            sSortAsc: "sorting_asc",
            sSortDesc: "sorting_desc",
            sSortable: "sorting",
            sSortableAsc: "sorting_asc_disabled",
            sSortableDesc: "sorting_desc_disabled",
            sSortableNone: "sorting_disabled",
            sSortColumn: "sorting_",
            sSortJUIAsc: "",
            sSortJUIDesc: "",
            sSortJUI: "",
            sSortJUIAscAllowed: "",
            sSortJUIDescAllowed: "",
            sSortJUIWrapper: "",
            sSortIcon: "",
            sScrollWrapper: "dataTables_scroll",
            sScrollHead: "dataTables_scrollHead",
            sScrollHeadInner: "dataTables_scrollHeadInner",
            sScrollBody: "dataTables_scrollBody",
            sScrollFoot: "dataTables_scrollFoot",
            sScrollFootInner: "dataTables_scrollFootInner",
            sFooterTH: "",
            sJUIHeader: "",
            sJUIFooter: ""
        }), h.extend(j.ext.oJUIClasses, j.ext.oStdClasses, {
            sPagePrevEnabled: "fg-button ui-button ui-state-default ui-corner-left",
            sPagePrevDisabled: "fg-button ui-button ui-state-default ui-corner-left ui-state-disabled",
            sPageNextEnabled: "fg-button ui-button ui-state-default ui-corner-right",
            sPageNextDisabled: "fg-button ui-button ui-state-default ui-corner-right ui-state-disabled",
            sPageJUINext: "ui-icon ui-icon-circle-arrow-e",
            sPageJUIPrev: "ui-icon ui-icon-circle-arrow-w",
            sPageButton: "fg-button ui-button ui-state-default",
            sPageButtonActive: "fg-button ui-button ui-state-default ui-state-disabled",
            sPageButtonStaticDisabled: "fg-button ui-button ui-state-default ui-state-disabled",
            sPageFirst: "first ui-corner-tl ui-corner-bl",
            sPageLast: "last ui-corner-tr ui-corner-br",
            sPaging: "dataTables_paginate fg-buttonset ui-buttonset fg-buttonset-multi ui-buttonset-multi paging_",
            sSortAsc: "ui-state-default",
            sSortDesc: "ui-state-default",
            sSortable: "ui-state-default",
            sSortableAsc: "ui-state-default",
            sSortableDesc: "ui-state-default",
            sSortableNone: "ui-state-default",
            sSortJUIAsc: "css_right ui-icon ui-icon-triangle-1-n",
            sSortJUIDesc: "css_right ui-icon ui-icon-triangle-1-s",
            sSortJUI: "css_right ui-icon ui-icon-carat-2-n-s",
            sSortJUIAscAllowed: "css_right ui-icon ui-icon-carat-1-n",
            sSortJUIDescAllowed: "css_right ui-icon ui-icon-carat-1-s",
            sSortJUIWrapper: "DataTables_sort_wrapper",
            sSortIcon: "DataTables_sort_icon",
            sScrollHead: "dataTables_scrollHead ui-state-default",
            sScrollFoot: "dataTables_scrollFoot ui-state-default",
            sFooterTH: "ui-state-default",
            sJUIHeader: "fg-toolbar ui-toolbar ui-widget-header ui-corner-tl ui-corner-tr ui-helper-clearfix",
            sJUIFooter: "fg-toolbar ui-toolbar ui-widget-header ui-corner-bl ui-corner-br ui-helper-clearfix"
        }), h.extend(j.ext.oPagination, {
            two_button: {
                fnInit: function (e, t, n) {
                    var r = e.oLanguage.oPaginate,
                        i = function (t) {
                            e.oApi._fnPageChange(e, t.data.action) && n(e)
                        }, r = e.bJUI ? '<a class="' + e.oClasses.sPagePrevDisabled + '" tabindex="' + e.iTabIndex + '" role="button"><span class="' + e.oClasses.sPageJUIPrev + '"></span></a><a class="' + e.oClasses.sPageNextDisabled + '" tabindex="' + e.iTabIndex + '" role="button"><span class="' + e.oClasses.sPageJUINext + '"></span></a>' : '<a class="' + e.oClasses.sPagePrevDisabled + '" tabindex="' + e.iTabIndex + '" role="button">' + r.sPrevious + '</a><a class="' + e.oClasses.sPageNextDisabled + '" tabindex="' + e.iTabIndex + '" role="button">' + r.sNext + "</a>";
                    h(t).append(r);
                    var s = h("a", t),
                        r = s[0],
                        s = s[1];
                    e.oApi._fnBindAction(r, {
                        action: "previous"
                    }, i), e.oApi._fnBindAction(s, {
                        action: "next"
                    }, i), e.aanFeatures.p || (t.id = e.sTableId + "_paginate", r.id = e.sTableId + "_previous", s.id = e.sTableId + "_next", r.setAttribute("aria-controls", e.sTableId), s.setAttribute("aria-controls", e.sTableId))
                },
                fnUpdate: function (e) {
                    if (e.aanFeatures.p)
                        for (var t = e.oClasses, n = e.aanFeatures.p, r, i = 0, s = n.length; i < s; i++)
                            if (r = n[i].firstChild) r.className = 0 === e._iDisplayStart ? t.sPagePrevDisabled : t.sPagePrevEnabled, r = r.nextSibling, r.className = e.fnDisplayEnd() == e.fnRecordsDisplay() ? t.sPageNextDisabled : t.sPageNextEnabled
                }
            },
            iFullNumbersShowPages: 5,
            full_numbers: {
                fnInit: function (e, t, n) {
                    var r = e.oLanguage.oPaginate,
                        i = e.oClasses,
                        s = function (t) {
                            e.oApi._fnPageChange(e, t.data.action) && n(e)
                        };
                    h(t).append('<a  tabindex="' + e.iTabIndex + '" class="' + i.sPageButton + " " + i.sPageFirst + '">' + r.sFirst + '</a><a  tabindex="' + e.iTabIndex + '" class="' + i.sPageButton + " " + i.sPagePrevious + '">' + r.sPrevious + '</a><span></span><a tabindex="' + e.iTabIndex + '" class="' + i.sPageButton + " " + i.sPageNext + '">' + r.sNext + '</a><a tabindex="' + e.iTabIndex + '" class="' + i.sPageButton + " " + i.sPageLast + '">' + r.sLast + "</a>");
                    var o = h("a", t),
                        r = o[0],
                        i = o[1],
                        u = o[2],
                        o = o[3];
                    e.oApi._fnBindAction(r, {
                        action: "first"
                    }, s), e.oApi._fnBindAction(i, {
                        action: "previous"
                    }, s), e.oApi._fnBindAction(u, {
                        action: "next"
                    }, s), e.oApi._fnBindAction(o, {
                        action: "last"
                    }, s), e.aanFeatures.p || (t.id = e.sTableId + "_paginate", r.id = e.sTableId + "_first", i.id = e.sTableId + "_previous", u.id = e.sTableId + "_next", o.id = e.sTableId + "_last")
                },
                fnUpdate: function (e, t) {
                    if (e.aanFeatures.p) {
                        var n = j.ext.oPagination.iFullNumbersShowPages,
                            r = Math.floor(n / 2),
                            i = Math.ceil(e.fnRecordsDisplay() / e._iDisplayLength),
                            s = Math.ceil(e._iDisplayStart / e._iDisplayLength) + 1,
                            o = "",
                            u, a = e.oClasses,
                            f, l = e.aanFeatures.p,
                            c = function (n) {
                                e.oApi._fnBindAction(this, {
                                    page: n + u - 1
                                }, function (n) {
                                    e.oApi._fnPageChange(e, n.data.page), t(e), n.preventDefault()
                                })
                            }; - 1 === e._iDisplayLength ? s = r = u = 1 : i < n ? (u = 1, r = i) : s <= r ? (u = 1, r = n) : s >= i - r ? (u = i - n + 1, r = i) : (u = s - Math.ceil(n / 2) + 1, r = u + n - 1);
                        for (n = u; n <= r; n++) o += s !== n ? '<a tabindex="' + e.iTabIndex + '" class="' + a.sPageButton + '">' + e.fnFormatNumber(n) + "</a>" : '<a tabindex="' + e.iTabIndex + '" class="' + a.sPageButtonActive + '">' + e.fnFormatNumber(n) + "</a>";
                        n = 0;
                        for (r = l.length; n < r; n++) f = l[n], f.hasChildNodes() && (h("span:eq(0)", f).html(o).children("a").each(c), f = f.getElementsByTagName("a"), f = [f[0], f[1], f[f.length - 2], f[f.length - 1]], h(f).removeClass(a.sPageButton + " " + a.sPageButtonActive + " " + a.sPageButtonStaticDisabled), h([f[0], f[1]]).addClass(1 == s ? a.sPageButtonStaticDisabled : a.sPageButton), h([f[2], f[3]]).addClass(0 === i || s === i || -1 === e._iDisplayLength ? a.sPageButtonStaticDisabled : a.sPageButton))
                    }
                }
            }
        }), h.extend(j.ext.oSort, {
            "string-pre": function (e) {
                return "string" != typeof e && (e = null !== e && e.toString ? e.toString() : ""), e.toLowerCase()
            },
            "string-asc": function (e, t) {
                return e < t ? -1 : e > t ? 1 : 0
            },
            "string-desc": function (e, t) {
                return e < t ? 1 : e > t ? -1 : 0
            },
            "html-pre": function (e) {
                return e.replace(/<.*?>/g, "").toLowerCase()
            },
            "html-asc": function (e, t) {
                return e < t ? -1 : e > t ? 1 : 0
            },
            "html-desc": function (e, t) {
                return e < t ? 1 : e > t ? -1 : 0
            },
            "date-pre": function (e) {
                e = Date.parse(e);
                if (isNaN(e) || "" === e) e = Date.parse("01/01/1970 00:00:00");
                return e
            },
            "date-asc": function (e, t) {
                return e - t
            },
            "date-desc": function (e, t) {
                return t - e
            },
            "numeric-pre": function (e) {
                return "-" == e || "" === e ? 0 : 1 * e
            },
            "numeric-asc": function (e, t) {
                return e - t
            },
            "numeric-desc": function (e, t) {
                return t - e
            }
        }), h.extend(j.ext.aTypes, [
            function (e) {
                if ("number" == typeof e) return "numeric";
                if ("string" != typeof e) return null;
                var t, n = !1;
                t = e.charAt(0);
                if (-1 == "0123456789-".indexOf(t)) return null;
                for (var r = 1; r < e.length; r++) {
                    t = e.charAt(r);
                    if (-1 == "0123456789.".indexOf(t)) return null;
                    if ("." == t) {
                        if (n) return null;
                        n = !0
                    }
                }
                return "numeric"
            },
            function (e) {
                var t = Date.parse(e);
                return null !== t && !isNaN(t) || "string" == typeof e && 0 === e.length ? "date" : null
            },
            function (e) {
                return "string" == typeof e && -1 != e.indexOf("<") && -1 != e.indexOf(">") ? "html" : null
            }
        ]), h.fn.DataTable = j, h.fn.dataTable = j, h.fn.dataTableSettings = j.settings, h.fn.dataTableExt = j.ext
    };
    "function" == typeof define && define.amd ? define(["jquery"], L) : jQuery && !jQuery.fn.dataTable && L(jQuery)
}(window, document), $(document).ready(function () {
    function n(e) {
        e.wrap("<div class='table-wrapper' />");
        var t = e.clone();
        t.find("td:not(:first-child), th:not(:first-child)").css("display", "none"), t.removeClass("responsive"), e.closest(".table-wrapper").append(t), t.wrap("<div class='pinned' />"), e.wrap("<div class='scrollable' />"), i(e, t)
    }

    function r(e) {
        e.closest(".table-wrapper").find(".pinned").remove(), e.unwrap(), e.unwrap()
    }

    function i(e, t) {
        var n = e.find("tr"),
            r = t.find("tr"),
            i = [];
        n.each(function (e) {
            var t = $(this),
                n = t.find("th, td");
            n.each(function () {
                var t = $(this).outerHeight(!0);
                i[e] = i[e] || 0, t > i[e] && (i[e] = t)
            })
        }), r.each(function (e) {
            $(this).height(i[e])
        })
    }
    var e = !1,
        t = function () {
            if ($(window).width() < 767 && !e) return e = !0, $("table.responsive").each(function (e, t) {
                n($(t))
            }), !0;
            e && $(window).width() > 767 && (e = !1, $("table.responsive").each(function (e, t) {
                r($(t))
            }))
        };
    $(window).load(t), $(window).bind("resize", t)
}),
function (e) {
    e.fn.wizard = function (e) {
        return new Wizard(this, e)
    }, e.fn.wizard.logging = !1, WizardCard = function (e, t, n, r, i) {
        this.wizard = e, this.index = n, this.prev = r, this.next = i, this.el = t, this.title = t.find("h3").first().text(), this.name = t.data("cardname") || this.title, this.nav = this._createNavElement(this.title, n), this._disabled = !1, this._loaded = !1, this._events = {}
    }, WizardCard.prototype = {
        select: function () {
            this.log("selecting"), this.isSelected() || (this.nav.addClass("active"), this.el.show(), this._loaded || (this.trigger("loaded"), this.reload()), this.trigger("selected"));
            var e = this.wizard;
            return this.index >= e._cards.length - 1 ? (this.log("on last card, changing next button to submit"), e.changeNextButton(e.args.buttons.submitText, "btn-green"), e._readyToSubmit = !0, e.trigger("readySubmit")) : (e._readyToSubmit = !1, this.index == 0 ? e.backButton.toggleClass("disabled", !0) : e.backButton.toggleClass("disabled", !1), e.changeNextButton(e.args.buttons.nextText, "btn-blue")), this
        },
        _createNavElement: function (t, n) {
            var r = e('<li class="wizard-nav-item"></li>'),
                i = e('<a class="wizard-nav-link"></a>');
            return i.data("navindex", n), r.append(i), i.append('<i class="icon-chevron-right"></i>'), i.append(t), r
        },
        markVisited: function () {
            return this.log("marking as visited"), this.nav.addClass("already-visited"), this.trigger("markVisited"), this
        },
        unmarkVisited: function () {
            return this.log("unmarking as visited"), this.nav.removeClass("already-visited"), this.trigger("unmarkVisited"), this
        },
        deselect: function () {
            return this.nav.removeClass("active"), this.el.hide(), this.trigger("deselect"), this
        },
        enable: function () {
            return this.log("enabling"), this.nav.addClass("active"), this._disabled = !1, this.trigger("enabled"), this
        },
        disable: function (e) {
            return this.log("disabling"), this._disabled = !0, this.nav.removeClass("active already-visited"), e && this.el.hide(), this.trigger("disabled"), this
        },
        isDisabled: function () {
            return this._disabled
        },
        alreadyVisited: function () {
            return this.nav.hasClass("already-visited")
        },
        isSelected: function () {
            return this.nav.hasClass("active")
        },
        reload: function () {
            return this._loaded = !0, this.trigger("reload"), this
        },
        on: function () {
            return this.wizard.on.apply(this, arguments)
        },
        trigger: function () {
            return this.callListener("on" + arguments[0]), this.wizard.trigger.apply(this, arguments)
        },
        toggleAlert: function (t, n) {
            this.log("toggling alert to: " + n), n = typeof n == "undefined" ? !0 : n, n ? this.trigger("showAlert") : this.trigger("hideAlert");
            var r, i = this.el.children("h3").first().next("div.alert");
            if (i.length == 0) {
                if (!n) return this;
                this.log("couldn't find existing alert div, creating one"), r = e("<div />"), r.addClass("alert"), r.addClass("hide"), r.insertAfter(this.el.find("h3").first())
            } else this.log("found existing alert div"), r = i.first();
            return n ? (t != null && (this.log("setting alert msg to", t), r.html(t)), r.show()) : r.hide(), this
        },
        callListener: function (e) {
            e = e.toLowerCase(), this.log("looking for listener " + e);
            var t = window[this.el.data(e)];
            if (t) {
                this.log("calling listener " + e);
                var n = this.wizard;
                try {
                    var r = t(this)
                } catch (i) {
                    this.log("exception calling listener " + e + ": ", i)
                }
            } else this.log("didn't find listener " + e)
        },
        problem: function (e) {
            this.nav.find("a").toggleClass("wizard-step-error", e)
        },
        validate: function () {
            var t = !1,
                n = this;
            this.el.find("[data-validate]").each(function (r, i) {
                n.log("validating individiual inputs"), i = e(i);
                var s = i.data("validate");
                if (!s) return;
                var o = {
                    status: !0,
                    title: "Error",
                    msg: ""
                }, u = window[s](i);
                e.extend(o, u);
                if (!o.status) t = !0, i.parent(".control-group").toggleClass("error", !0), n.wizard.errorPopover(i, o.msg);
                else {
                    i.parent(".control-group").toggleClass("error", !1);
                    try {
                        i.popover("destroy")
                    } catch (a) {
                        i.popover("hide")
                    }
                }
            }), this.log("after validating inputs, failures is", t);
            var r = window[this.el.data("validate")];
            if (r) {
                this.log("running html-embedded card validator");
                var i = r(this);
                if (typeof i == "undefined" || i == null) i = !0;
                i || (t = !0), this.log("after running html-embedded card validator, failures is", t)
            }
            this.log("running listener validator");
            var s = this.trigger("validate");
            if (typeof s == "undefined" || s == null) s = !0;
            s || (t = !0), this.log("after running listener validator, failures is", t);
            var o = !t;
            return o ? (this.log("validated, calling listeners"), this.trigger("validated")) : (this.log("invalid"), this.trigger("invalid")), o
        },
        log: function () {
            if (!window.console || !e.fn.wizard.logging) return;
            var t = "card '" + this.name + "': ",
                n = [t];
            n.push.apply(n, arguments), console.log.apply(console, n)
        },
        isActive: function () {
            return this.nav.hasClass("active")
        }
    }, Wizard = function (t, n) {
        var r = ['<div class="modal hide wizard-modal" role="dialog">', '<div class="wizard-modal-header modal-header">', '<button class="wizard-close close" type="button">x</button>', '<h3 class="wizard-title"></h3>', '<span class="wizard-subtitle"></span>', "</div>", '<div class="pull-left wizard-steps">', '<div class="wizard-nav-container">', '<ul class="nav nav-list" style="padding-bottom:30px;">', "</ul>", "</div>", '<div class="wizard-progress-container">', , '<div class="progress progress-striped">', '<div class="bar"></div>', "</div>", "</div>", "</div>", "<form>", '<div class="wizard-cards">', '<div class="wizard-card-container">', "</div>", '<div class="wizard-modal-footer">', '<div class="wizard-buttons-container">', '<button class="btn btn-default wizard-back" type="button">Back</button>', '<button class="btn btn-blue wizard-next" type="button">Next</button>', "</div>", "</div>", "</div>", "</form>", "</div>"];
        this.args = {
            submitUrl: "",
            width: 750,
            progressBarCurrent: !1,
            increaseHeight: 0,
            buttons: {
                nextText: "Next",
                backText: "Back",
                submitText: "Submit",
                submittingText: "Submitting..."
            }
        }, e.extend(this.args, n || {}), this.markup = e(t), this.submitCards = this.markup.find(".wizard-error,.wizard-failure,.wizard-success,.wizard-loading"), this.el = e(r.join("\n")), this.el.find(".wizard-card-container").append(this.markup.find(".wizard-card")).append(this.submitCards), e("body").append(this.el), this.closeButton = this.el.find("button.wizard-close"), this.footer = this.el.find(".wizard-modal-footer"), this.backButton = this.footer.find(".wizard-back"), this.nextButton = this.footer.find(".wizard-next"), this.progress = this.el.find(".progress"), this._cards = [], this.cards = {}, this._readyToSubmit = !1, this.percentComplete = 0, this._submitting = !1, this._events = {}, this._firstShow = !0, this._createCards(), this.nextButton.click(this, this._handleNextClick), this.backButton.click(this, this._handleBackClick), this.backButton.text(this.args.buttons.backText), this.nextButton.text(this.args.buttons.nextText);
        var i = 360,
            s = i + this.args.increaseHeight;
        this.el.find(".wizard-nav-container").css("height", s), this.el.find(".wizard-steps").css("height", s + 65 + "px"), this.el.find(".wizard-card").css("height", s - 60 + "px"), this.submitCards.css("height", s - 60 + "px"), this.el.css("margin-top", -(this.el.height() / 2)), this.el.css("width", this.args.width), this.el.css("margin-left", -(this.args.width / 2));
        if (e.fn.slimScroll && !1) {
            var o = {
                position: "left",
                height: "360px",
                size: "8px",
                distance: "5px",
                railVisible: !0,
                disableFadeOut: !0
            };
            e.extend(o, this.args.slimScroll || {}), this.el.find(".wizard-nav-container").slimScroll(o)
        }
        var u = this;
        this.closeButton.click(function () {
            u.reset(), u.close()
        }), this.el.find(".wizard-steps").on("click", "li.already-visited a.wizard-nav-link", this, function (t) {
            var n = parseInt(e(t.target).data("navindex"));
            t.data.setCard(n)
        });
        var a = this.markup.children("h1").first();
        a.length && this.setTitle(a.text()), this.on("submit", this._defaultSubmit)
    }, Wizard.prototype = {
        errorPopover: function (e, t) {
            this.log("launching popover on", e);
            var n = e.popover({
                content: t,
                trigger: "manual"
            }).popover("show").next(".popover");
            return n.addClass("error-popover"), n
        },
        eachCard: function (t) {
            return e.each(this._cards, t), this
        },
        getActiveCard: function () {
            this.log("getting active card");
            var t = null;
            return e.each(this._cards, function (e, n) {
                if (n.isActive()) return t = n, !1
            }), t ? this.log("found active card", t) : this.log("couldn't find an active card"), t
        },
        setTitle: function (e) {
            return this.log("setting title to", e), this.el.find(".wizard-title").first().text(e), this
        },
        setSubtitle: function (e) {
            return this.log("setting subtitle to", e), this.el.find(".wizard-subtitle").first().text(e), this
        },
        changeNextButton: function (e, t) {
            return this.log("changing next button, text: " + e, "class: " + t), typeof t != "undefined" && this.nextButton.removeClass("btn-green btn-blue"), t && this.nextButton.addClass(t), this.nextButton.text(e), this
        },
        hide: function () {
            return this.log("hiding"), this.el.modal("hide"), this
        },
        close: function () {
            return this.log("closing"), this.el.modal("hide"), this
        },
        show: function () {
            return this.log("showing"), this._firstShow && (this.setCard(0), this._firstShow = !1), this.el.modal(), this
        },
        on: function (e, t) {
            return this.log("adding listener to event " + e), this._events[e] = t, this
        },
        trigger: function () {
            var e = arguments[0],
                t = Array.prototype.slice.call(arguments);
            t.shift(), t.unshift(this), this.log("firing event " + e);
            var n = this._events[e],
                r = null;
            if (typeof n == "function") {
                this.log("found event handler, calling " + e);
                try {
                    r = n.apply(this, t)
                } catch (i) {
                    this.log("event handler " + e + " had an exception")
                }
            } else this.log("couldn't find an event handler for " + e);
            return r
        },
        reset: function () {
            return this.log("resetting"), this.updateProgressBar(0), this.hideSubmitCards(), this.setCard(0), this.lockCards(), this.enableNextButton(), this.showButtons(), this.trigger("reset"), this
        },
        log: function () {
            if (!window.console || !e.fn.wizard.logging) return;
            var t = "wizard " + this.el.id + ": ",
                n = [t];
            n.push.apply(n, arguments), console.log.apply(console, n)
        },
        _abstractIncrementStep: function (e, t) {
            var n = this.getActiveCard(),
                r;
            if (n) {
                this.log("searching for valid next card");
                for (;;) {
                    r = t(n);
                    if (r) {
                        this.log("looking at card", r.index);
                        if (r.isDisabled()) {
                            this.log("card " + r.index + " is disabled/locked, continuing"), n = r;
                            continue
                        }
                        return this.setCard(n.index + e)
                    }
                    this.log("next card is not defined, breaking");
                    break
                }
            } else this.log("current card is undefined")
        },
        incrementCard: function () {
            this.log("incrementing card");
            var e = this._abstractIncrementStep(1, function (e) {
                return e.next
            });
            return this.trigger("incrementCard"), e
        },
        decrementCard: function () {
            this.log("decrementing card");
            var e = this._abstractIncrementStep(-1, function (e) {
                return e.prev
            });
            return this.trigger("decrementCard"), e
        },
        setCard: function (e) {
            this.log("setting card to " + e), this.hideSubmitCards();
            var t = this.getActiveCard();
            if (this._submitting) return this.log("we're submitting the wizard already, can't change cards"), t;
            var n = this._cards[e];
            if (n) {
                if (n.isDisabled()) return this.log("new card is currently disabled, returning"), t;
                if (t) {
                    if (e > t.index) {
                        var r = t,
                            i = !1;
                        while (r.index != n.index) {
                            r.index != t.index && (r.prev.deselect(), r.prev.markVisited(), r.select()), i = r.validate();
                            if (!i) return r;
                            r = r.next
                        }
                        r.prev.deselect(), r.prev.markVisited()
                    }
                    t.deselect(), t.markVisited()
                }
                n.select();
                if (this.args.progressBarCurrent) {
                    var s = this.percentComplete;
                    this.percentComplete = e * 100 / this._cards.length, this.updateProgressBar(this.percentComplete)
                } else {
                    var s = this.percentComplete;
                    this.percentComplete = e * 100 / this._cards.length, this.percentComplete = Math.max(s, this.percentComplete), this.updateProgressBar(this.percentComplete)
                }
                return n
            }
            this.log("couldn't find card " + e)
        },
        updateProgressBar: function (e) {
            this.log("updating progress to " + e + "%"), this.progress.find(".bar").css({
                width: e + "%"
            }), this.percentComplete = e, this.trigger("progressBar", e), e == 100 ? (this.log("progress is 100, animating progress bar"), this.progress.addClass("active")) : e == 0 && (this.log("progress is 0, disabling animation"), this.progress.removeClass("active"))
        },
        getNextCard: function () {
            var e = this.getActiveCard();
            if (e) return e.next
        },
        lockCards: function () {
            return this.log("locking nav cards"), this.eachCard(function (e, t) {
                t.unmarkVisited()
            }), this
        },
        disableCards: function () {
            return this.log("disabling all nav cards"), this.eachCard(function (e, t) {
                t.disable()
            }), this
        },
        enableCards: function () {
            return this.log("enabling all nav cards"), this.eachCard(function (e, t) {
                t.enable()
            }), this
        },
        hideCards: function () {
            return this.log("hiding cards"), this.eachCard(function (e, t) {
                t.deselect()
            }), this.hideSubmitCards(), this
        },
        hideButtons: function () {
            return this.log("hiding buttons"), this.nextButton.hide(), this.backButton.hide(), this
        },
        showButtons: function () {
            return this.log("showing buttons"), this.nextButton.show(), this.backButton.show(), this
        },
        getCard: function (t) {
            var n = e(t).parents(".wizard-card").first()[0];
            if (n) {
                var r = null;
                return this.eachCard(function (e, t) {
                    return n == t.el[0] ? (r = t, !1) : !0
                }), r
            }
            return null
        },
        _createCards: function () {
            var t = null,
                n = null,
                r = 0,
                i = null,
                s = this,
                o = this,
                u = this.el.find(".wizard-cards .wizard-card");
            e.each(u, function (r, u) {
                u = e(u), t = i, i = new WizardCard(s, u, r, t, n), o._cards.push(i), i.name && (o.cards[i.name] = i), t && (t.next = i), o.el.find(".wizard-steps .nav-list").append(i.nav)
            })
        },
        showSubmitCard: function (e) {
            this.log("showing " + e + " submit card");
            var t = this.el.find(".wizard-" + e);
            t.length ? (this.hideCards(), this.el.find(".wizard-" + e).show()) : this.log("couldn't find submit card " + e)
        },
        hideSubmitCard: function (e) {
            this.log("hiding " + e + " submit card"), this.el.find(".wizard-" + e).hide()
        },
        hideSubmitCards: function () {
            var t = this;
            e.each(["success", "error", "failure", "loading"], function (e, n) {
                t.hideSubmitCard(n)
            })
        },
        enableNextButton: function () {
            return this.log("enabling next button"), this.nextButton.removeAttr("disabled"), this
        },
        disableNextButton: function () {
            return this.log("disabling next button"), this.nextButton.attr("disabled", "disabled"), this
        },
        serializeArray: function () {
            var e = this.el.children("form").first();
            return e.serializeArray()
        },
        serialize: function () {
            var e = this.el.children("form").first();
            return e.serialize()
        },
        submitSuccess: function () {
            this.log("submit success"), this._submitting = !1, this.showSubmitCard("success"), this.trigger("submitSuccess")
        },
        submitFailure: function () {
            this.log("submit failure"), this._submitting = !1, this.showSubmitCard("failure"), this.trigger("submitFailure")
        },
        submitError: function () {
            this.log("submit error"), this._submitting = !1, this.showSubmitCard("error"), this.trigger("submitError")
        },
        _submit: function () {
            this.log("submitting wizard"), this._submitting = !0, this.lockCards(), this.backButton.hide(), this.showSubmitCard("loading"), this.updateProgressBar(100), this.changeNextButton(this.args.buttons.submittingText, !1), this.disableNextButton();
            var e = this.trigger("submit");
            this.trigger("loading")
        },
        _onNextClick: function () {
            this.log("handling 'next' button click");
            if (this._readyToSubmit) this._submit();
            else var e = this.incrementCard()
        },
        _onBackClick: function () {
            this.log("handling 'back' button click");
            var e = this.decrementCard()
        },
        _handleNextClick: function (e) {
            var t = e.data;
            t._onNextClick.call(t)
        },
        _handleBackClick: function (e) {
            var t = e.data;
            t._onBackClick.call(t)
        },
        _defaultSubmit: function (t) {
            e.ajax({
                type: "POST",
                url: t.args.submitUrl,
                data: t.serialize(),
                dataType: "json",
                success: function (e) {
                    t.submitSuccess(), t.hideButtons(), t.updateProgressBar(0)
                },
                error: function () {
                    t.submitFailure(), t.hideButtons()
                }
            })
        }
    }
}(window.jQuery), $(function () {
    $.fn.wizard.logging = !0;
    if ($("#wizard-demo").length > 0) {
        var e = $("#wizard-demo").wizard();
        e.el.find(".wizard-ns-select").change(function () {
            e.el.find(".wizard-ns-detail").show()
        }), e.el.find(".create-server-service-list").change(function () {
            var t = $(this).find("option:selected").length == 0;
            e.getCard(this).toggleAlert(null, t)
        }), e.cards.name.on("validated", function (e) {
            var t = e.el.find("#new-server-fqdn").val()
        }), e.on("submit", function (e) {
            var t = {
                hostname: $("#new-server-fqdn").val()
            };
            setTimeout(function () {
                e.trigger("success"), e.hideButtons(), e._submitting = !1, e.showSubmitCard("success"), e._updateProgressBar(0)
            }, 2e3)
        }), e.on("reset", function (e) {
            e.setSubtitle(""), e.el.find("#new-server-fqdn").val(""), e.el.find("#new-server-name").val("")
        }), e.el.find(".wizard-success .im-done").click(function () {
            e.reset().close()
        }), e.el.find(".wizard-success .create-another-server").click(function () {
            e.reset()
        }), $(".wizard-group-list").click(function () {
            alert("Disabled for demo.")
        }), $("#open-wizard").click(function () {
            e.show()
        }), e.show()
    }
}),
function (e) {
    e.fn.validationEngineLanguage = function () {}, e.validationEngineLanguage = {
        newLang: function () {
            e.validationEngineLanguage.allRules = {
                required: {
                    regex: "none",
                    alertText: "* This field is required",
                    alertTextCheckboxMultiple: "* Please select an option",
                    alertTextCheckboxe: "* This checkbox is required",
                    alertTextDateRange: "* Both date range fields are required"
                },
                requiredInFunction: {
                    func: function (e, t, n, r) {
                        return e.val() == "test" ? !0 : !1
                    },
                    alertText: "* Field must equal test"
                },
                dateRange: {
                    regex: "none",
                    alertText: "* Invalid ",
                    alertText2: "Date Range"
                },
                dateTimeRange: {
                    regex: "none",
                    alertText: "* Invalid ",
                    alertText2: "Date Time Range"
                },
                minSize: {
                    regex: "none",
                    alertText: "* Minimum ",
                    alertText2: " characters required"
                },
                maxSize: {
                    regex: "none",
                    alertText: "* Maximum ",
                    alertText2: " characters allowed"
                },
                groupRequired: {
                    regex: "none",
                    alertText: "* You must fill one of the following fields"
                },
                min: {
                    regex: "none",
                    alertText: "* Minimum value is "
                },
                max: {
                    regex: "none",
                    alertText: "* Maximum value is "
                },
                past: {
                    regex: "none",
                    alertText: "* Date prior to "
                },
                future: {
                    regex: "none",
                    alertText: "* Date past "
                },
                maxCheckbox: {
                    regex: "none",
                    alertText: "* Maximum ",
                    alertText2: " options allowed"
                },
                minCheckbox: {
                    regex: "none",
                    alertText: "* Please select ",
                    alertText2: " options"
                },
                equals: {
                    regex: "none",
                    alertText: "* Fields do not match"
                },
                creditCard: {
                    regex: "none",
                    alertText: "* Invalid credit card number"
                },
                phone: {
                    regex: /^([\+][0-9]{1,3}[\ \.\-])?([\(]{1}[0-9]{2,6}[\)])?([0-9\ \.\-\/]{3,20})((x|ext|extension)[\ ]?[0-9]{1,4})?$/,
                    alertText: "* Invalid phone number"
                },
                email: {
                    regex: /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,
                    alertText: "* Invalid email address"
                },
                integer: {
                    regex: /^[\-\+]?\d+$/,
                    alertText: "* Not a valid integer"
                },
                number: {
                    regex: /^[\-\+]?((([0-9]{1,3})([,][0-9]{3})*)|([0-9]+))?([\.]([0-9]+))?$/,
                    alertText: "* Invalid floating decimal number"
                },
                date: {
                    func: function (e) {
                        var t = new RegExp(/^(\d{4})[\/\-\.](0?[1-9]|1[012])[\/\-\.](0?[1-9]|[12][0-9]|3[01])$/),
                            n = t.exec(e.val());
                        if (n == null) return !1;
                        var r = n[1],
                            i = n[2] * 1,
                            s = n[3] * 1,
                            o = new Date(r, i - 1, s);
                        return o.getFullYear() == r && o.getMonth() == i - 1 && o.getDate() == s
                    },
                    alertText: "* Invalid date, must be in YYYY-MM-DD format"
                },
                ipv4: {
                    regex: /^((([01]?[0-9]{1,2})|(2[0-4][0-9])|(25[0-5]))[.]){3}(([0-1]?[0-9]{1,2})|(2[0-4][0-9])|(25[0-5]))$/,
                    alertText: "* Invalid IP address"
                },
                url: {
                    regex: /^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,
                    alertText: "* Invalid URL"
                },
                onlyNumberSp: {
                    regex: /^[0-9\ ]+$/,
                    alertText: "* Numbers only"
                },
                onlyLetterSp: {
                    regex: /^[a-zA-Z\ \']+$/,
                    alertText: "* Letters only"
                },
                onlyLetterNumber: {
                    regex: /^[0-9a-zA-Z]+$/,
                    alertText: "* No special characters allowed"
                },
                ajaxUserCall: {
                    url: "ajaxValidateFieldUser",
                    extraData: "name=eric",
                    alertText: "* This user is already taken",
                    alertTextLoad: "* Validating, please wait"
                },
                ajaxUserCallPhp: {
                    url: "phpajax/ajaxValidateFieldUser.php",
                    extraData: "name=eric",
                    alertTextOk: "* This username is available",
                    alertText: "* This user is already taken",
                    alertTextLoad: "* Validating, please wait"
                },
                ajaxNameCall: {
                    url: "ajaxValidateFieldName",
                    alertText: "* This name is already taken",
                    alertTextOk: "* This name is available",
                    alertTextLoad: "* Validating, please wait"
                },
                ajaxNameCallPhp: {
                    url: "phpajax/ajaxValidateFieldName.php",
                    alertText: "* This name is already taken",
                    alertTextLoad: "* Validating, please wait"
                },
                validate2fields: {
                    alertText: "* Please input HELLO"
                },
                dateFormat: {
                    regex: /^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$|^(?:(?:(?:0?[13578]|1[02])(\/|-)31)|(?:(?:0?[1,3-9]|1[0-2])(\/|-)(?:29|30)))(\/|-)(?:[1-9]\d\d\d|\d[1-9]\d\d|\d\d[1-9]\d|\d\d\d[1-9])$|^(?:(?:0?[1-9]|1[0-2])(\/|-)(?:0?[1-9]|1\d|2[0-8]))(\/|-)(?:[1-9]\d\d\d|\d[1-9]\d\d|\d\d[1-9]\d|\d\d\d[1-9])$|^(0?2(\/|-)29)(\/|-)(?:(?:0[48]00|[13579][26]00|[2468][048]00)|(?:\d\d)?(?:0[48]|[2468][048]|[13579][26]))$/,
                    alertText: "* Invalid Date"
                },
                dateTimeFormat: {
                    regex: /^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])\s+(1[012]|0?[1-9]){1}:(0?[1-5]|[0-6][0-9]){1}:(0?[0-6]|[0-6][0-9]){1}\s+(am|pm|AM|PM){1}$|^(?:(?:(?:0?[13578]|1[02])(\/|-)31)|(?:(?:0?[1,3-9]|1[0-2])(\/|-)(?:29|30)))(\/|-)(?:[1-9]\d\d\d|\d[1-9]\d\d|\d\d[1-9]\d|\d\d\d[1-9])$|^((1[012]|0?[1-9]){1}\/(0?[1-9]|[12][0-9]|3[01]){1}\/\d{2,4}\s+(1[012]|0?[1-9]){1}:(0?[1-5]|[0-6][0-9]){1}:(0?[0-6]|[0-6][0-9]){1}\s+(am|pm|AM|PM){1})$/,
                    alertText: "* Invalid Date or Date Format",
                    alertText2: "Expected Format: ",
                    alertText3: "mm/dd/yyyy hh:mm:ss AM|PM or ",
                    alertText4: "yyyy-mm-dd hh:mm:ss AM|PM"
                }
            }
        }
    }, e.validationEngineLanguage.newLang()
}(jQuery),
function (e) {
    "use strict";
    var t = {
        init: function (n) {
            var r = this;
            if (!r.data("jqv") || r.data("jqv") == null) n = t._saveOptions(r, n), e(document).on("click", ".formError", function () {
                e(this).fadeOut(150, function () {
                    e(this).parent(".formErrorOuter").remove(), e(this).remove()
                })
            });
            return this
        },
        attach: function (n) {
            var r = this,
                i;
            return n ? i = t._saveOptions(r, n) : i = r.data("jqv"), i.validateAttribute = r.find("[data-validation-engine*=validate]").length ? "data-validation-engine" : "class", i.binded && (r.on(i.validationEventTrigger, "[" + i.validateAttribute + "*=validate]:not([type=checkbox]):not([type=radio]):not(.datepicker)", t._onFieldEvent), r.on("click", "[" + i.validateAttribute + "*=validate][type=checkbox],[" + i.validateAttribute + "*=validate][type=radio]", t._onFieldEvent), r.on(i.validationEventTrigger, "[" + i.validateAttribute + "*=validate][class*=datepicker]", {
                delay: 300
            }, t._onFieldEvent)), i.autoPositionUpdate && e(window).bind("resize", {
                noAnimation: !0,
                formElem: r
            }, t.updatePromptsPosition), r.on("click", "a[data-validation-engine-skip], a[class*='validate-skip'], button[data-validation-engine-skip], button[class*='validate-skip'], input[data-validation-engine-skip], input[class*='validate-skip']", t._submitButtonClick), r.removeData("jqv_submitButton"), r.on("submit", t._onSubmitEvent), this
        },
        detach: function () {
            var n = this,
                r = n.data("jqv");
            return n.find("[" + r.validateAttribute + "*=validate]").not("[type=checkbox]").off(r.validationEventTrigger, t._onFieldEvent), n.find("[" + r.validateAttribute + "*=validate][type=checkbox],[class*=validate][type=radio]").off("click", t._onFieldEvent), n.off("submit", t.onAjaxFormComplete), n.die("submit", t.onAjaxFormComplete), n.removeData("jqv"), n.off("click", "a[data-validation-engine-skip], a[class*='validate-skip'], button[data-validation-engine-skip], button[class*='validate-skip'], input[data-validation-engine-skip], input[class*='validate-skip']", t._submitButtonClick), n.removeData("jqv_submitButton"), r.autoPositionUpdate && e(window).unbind("resize", t.updatePromptsPosition), this
        },
        validate: function () {
            var n = e(this),
                r = null;
            if ((n.is("form") || n.hasClass("validationEngineContainer")) && !n.hasClass("validating")) {
                n.addClass("validating");
                var i = n.data("jqv"),
                    r = t._validateFields(this);
                setTimeout(function () {
                    n.removeClass("validating")
                }, 100), r && i.onSuccess ? i.onSuccess() : !r && i.onFailure && i.onFailure()
            } else if (n.is("form") || n.hasClass("validationEngineContainer")) n.removeClass("validating");
            else {
                var s = n.closest("form, .validationEngineContainer"),
                    i = s.data("jqv") ? s.data("jqv") : e.validationEngine.defaults,
                    r = t._validateField(n, i);
                r && i.onFieldSuccess ? i.onFieldSuccess() : i.onFieldFailure && i.InvalidFields.length > 0 && i.onFieldFailure()
            }
            return i.onValidationComplete ? !! i.onValidationComplete(s, r) : r
        },
        updatePromptsPosition: function (n) {
            if (n && this == window) var r = n.data.formElem,
            i = n.data.noAnimation;
            else var r = e(this.closest("form, .validationEngineContainer"));
            var s = r.data("jqv");
            return r.find("[" + s.validateAttribute + "*=validate]").not(":disabled").each(function () {
                var n = e(this);
                s.prettySelect && n.is(":hidden") && (n = r.find("#" + s.usePrefix + n.attr("id") + s.useSuffix));
                var o = t._getPrompt(n),
                    u = e(o).find(".formErrorContent").html();
                o && t._updatePrompt(n, e(o), u, undefined, !1, s, i)
            }), this
        },
        showPrompt: function (e, n, r, i) {
            var s = this.closest("form, .validationEngineContainer"),
                o = s.data("jqv");
            return o || (o = t._saveOptions(this, o)), r && (o.promptPosition = r), o.showArrow = i == 1, t._showPrompt(this, e, n, !1, o), this
        },
        hide: function () {
            var n = e(this).closest("form, .validationEngineContainer"),
                r = n.data("jqv"),
                i = r && r.fadeDuration ? r.fadeDuration : .3,
                s;
            return e(this).is("form") || e(this).hasClass("validationEngineContainer") ? s = "parentForm" + t._getClassName(e(this).attr("id")) : s = t._getClassName(e(this).attr("id")) + "formError", e("." + s).fadeTo(i, .3, function () {
                e(this).parent(".formErrorOuter").remove(), e(this).remove()
            }), this
        },
        hideAll: function () {
            var t = this,
                n = t.data("jqv"),
                r = n ? n.fadeDuration : 300;
            return e(".formError").fadeTo(r, 300, function () {
                e(this).parent(".formErrorOuter").remove(), e(this).remove()
            }), this
        },
        _onFieldEvent: function (n) {
            var r = e(this),
                i = r.closest("form, .validationEngineContainer"),
                s = i.data("jqv");
            s.eventTrigger = "field", window.setTimeout(function () {
                t._validateField(r, s), s.InvalidFields.length == 0 && s.onFieldSuccess ? s.onFieldSuccess() : s.InvalidFields.length > 0 && s.onFieldFailure && s.onFieldFailure()
            }, n.data ? n.data.delay : 0)
        },
        _onSubmitEvent: function () {
            var n = e(this),
                r = n.data("jqv");
            if (n.data("jqv_submitButton")) {
                var i = e("#" + n.data("jqv_submitButton"));
                if (i && i.length > 0)
                    if (i.hasClass("validate-skip") || i.attr("data-validation-engine-skip") == "true") return !0
            }
            r.eventTrigger = "submit";
            var s = t._validateFields(n);
            return s && r.ajaxFormValidation ? (t._validateFormWithAjax(n, r), !1) : r.onValidationComplete ? !! r.onValidationComplete(n, s) : s
        },
        _checkAjaxStatus: function (t) {
            var n = !0;
            return e.each(t.ajaxValidCache, function (e, t) {
                if (!t) return n = !1, !1
            }), n
        },
        _checkAjaxFieldStatus: function (e, t) {
            return t.ajaxValidCache[e] == 1
        },
        _validateFields: function (n) {
            var r = n.data("jqv"),
                i = !1;
            n.trigger("jqv.form.validating");
            var s = null;
            n.find("[" + r.validateAttribute + "*=validate]").not(":disabled").each(function () {
                var o = e(this),
                    u = [];
                if (e.inArray(o.attr("name"), u) < 0) {
                    i |= t._validateField(o, r), i && s == null && (o.is(":hidden") && r.prettySelect ? s = o = n.find("#" + r.usePrefix + t._jqSelector(o.attr("id")) + r.useSuffix) : s = o);
                    if (r.doNotShowAllErrosOnSubmit) return !1;
                    u.push(o.attr("name"));
                    if (r.showOneMessage == 1 && i) return !1
                }
            }), n.trigger("jqv.form.result", [i]);
            if (i) {
                if (r.scroll) {
                    var o = s.offset().top,
                        u = s.offset().left,
                        a = r.promptPosition;
                    typeof a == "string" && a.indexOf(":") != -1 && (a = a.substring(0, a.indexOf(":")));
                    if (a != "bottomRight" && a != "bottomLeft") {
                        var f = t._getPrompt(s);
                        f && (o = f.offset().top)
                    }
                    r.scrollOffset && (o -= r.scrollOffset);
                    if (r.isOverflown) {
                        var l = e(r.overflownDIV);
                        if (!l.length) return !1;
                        var c = l.scrollTop(),
                            h = -parseInt(l.offset().top);
                        o += c + h - 5;
                        var p = e(r.overflownDIV + ":not(:animated)");
                        p.animate({
                            scrollTop: o
                        }, 1100, function () {
                            r.focusFirstField && s.focus()
                        })
                    } else e("html, body").animate({
                        scrollTop: o
                    }, 1100, function () {
                        r.focusFirstField && s.focus()
                    }), e("html, body").animate({
                        scrollLeft: u
                    }, 1100)
                } else r.focusFirstField && s.focus();
                return !1
            }
            return !0
        },
        _validateFormWithAjax: function (n, r) {
            var i = n.serialize(),
                s = r.ajaxFormValidationMethod ? r.ajaxFormValidationMethod : "GET",
                o = r.ajaxFormValidationURL ? r.ajaxFormValidationURL : n.attr("action"),
                u = r.dataType ? r.dataType : "json";
            e.ajax({
                type: s,
                url: o,
                cache: !1,
                dataType: u,
                data: i,
                form: n,
                methods: t,
                options: r,
                beforeSend: function () {
                    return r.onBeforeAjaxFormValidation(n, r)
                },
                error: function (e, n) {
                    t._ajaxError(e, n)
                },
                success: function (i) {
                    if (u == "json" && i !== !0) {
                        var s = !1;
                        for (var o = 0; o < i.length; o++) {
                            var a = i[o],
                                f = a[0],
                                l = e(e("#" + f)[0]);
                            if (l.length == 1) {
                                var c = a[2];
                                if (a[1] == 1)
                                    if (c == "" || !c) t._closePrompt(l);
                                    else {
                                        if (r.allrules[c]) {
                                            var h = r.allrules[c].alertTextOk;
                                            h && (c = h)
                                        }
                                        r.showPrompts && t._showPrompt(l, c, "pass", !1, r, !0)
                                    } else {
                                        s |= !0;
                                        if (r.allrules[c]) {
                                            var h = r.allrules[c].alertText;
                                            h && (c = h)
                                        }
                                        r.showPrompts && t._showPrompt(l, c, "", !1, r, !0)
                                    }
                            }
                        }
                        r.onAjaxFormComplete(!s, n, i, r)
                    } else r.onAjaxFormComplete(!0, n, i, r)
                }
            })
        },
        _validateField: function (n, r, i) {
            n.attr("id") || (n.attr("id", "form-validation-field-" + e.validationEngine.fieldIdCounter), ++e.validationEngine.fieldIdCounter);
            if (!r.validateNonVisibleFields && (n.is(":hidden") && !r.prettySelect || n.parent().is(":hidden"))) return !1;
            var s = n.attr(r.validateAttribute),
                o = /validate\[(.*)\]/.exec(s);
            if (!o) return !1;
            var u = o[1],
                a = u.split(/\[|,|\]/),
                f = !1,
                l = n.attr("name"),
                c = "",
                h = "",
                p = !1,
                d = !1;
            r.isError = !1, r.showArrow = !1, r.maxErrorsPerField > 0 && (d = !0);
            var v = e(n.closest("form, .validationEngineContainer"));
            for (var m = 0; m < a.length; m++) a[m] = a[m].replace(" ", ""), a[m] === "" && delete a[m];
            for (var m = 0, g = 0; m < a.length; m++) {
                if (d && g >= r.maxErrorsPerField) {
                    if (!p) {
                        var y = e.inArray("required", a);
                        p = y != -1 && y >= m
                    }
                    break
                }
                var b = undefined;
                switch (a[m]) {
                case "required":
                    p = !0, b = t._getErrorMessage(v, n, a[m], a, m, r, t._required);
                    break;
                case "custom":
                    b = t._getErrorMessage(v, n, a[m], a, m, r, t._custom);
                    break;
                case "groupRequired":
                    var w = "[" + r.validateAttribute + "*=" + a[m + 1] + "]",
                        E = v.find(w).eq(0);
                    E[0] != n[0] && (t._validateField(E, r, i), r.showArrow = !0), b = t._getErrorMessage(v, n, a[m], a, m, r, t._groupRequired), b && (p = !0), r.showArrow = !1;
                    break;
                case "ajax":
                    b = t._ajax(n, a, m, r), b && (h = "load");
                    break;
                case "minSize":
                    b = t._getErrorMessage(v, n, a[m], a, m, r, t._minSize);
                    break;
                case "maxSize":
                    b = t._getErrorMessage(v, n, a[m], a, m, r, t._maxSize);
                    break;
                case "min":
                    b = t._getErrorMessage(v, n, a[m], a, m, r, t._min);
                    break;
                case "max":
                    b = t._getErrorMessage(v, n, a[m], a, m, r, t._max);
                    break;
                case "past":
                    b = t._getErrorMessage(v, n, a[m], a, m, r, t._past);
                    break;
                case "future":
                    b = t._getErrorMessage(v, n, a[m], a, m, r, t._future);
                    break;
                case "dateRange":
                    var w = "[" + r.validateAttribute + "*=" + a[m + 1] + "]";
                    r.firstOfGroup = v.find(w).eq(0), r.secondOfGroup = v.find(w).eq(1);
                    if (r.firstOfGroup[0].value || r.secondOfGroup[0].value) b = t._getErrorMessage(v, n, a[m], a, m, r, t._dateRange);
                    b && (p = !0), r.showArrow = !1;
                    break;
                case "dateTimeRange":
                    var w = "[" + r.validateAttribute + "*=" + a[m + 1] + "]";
                    r.firstOfGroup = v.find(w).eq(0), r.secondOfGroup = v.find(w).eq(1);
                    if (r.firstOfGroup[0].value || r.secondOfGroup[0].value) b = t._getErrorMessage(v, n, a[m], a, m, r, t._dateTimeRange);
                    b && (p = !0), r.showArrow = !1;
                    break;
                case "maxCheckbox":
                    n = e(v.find("input[name='" + l + "']")), b = t._getErrorMessage(v, n, a[m], a, m, r, t._maxCheckbox);
                    break;
                case "minCheckbox":
                    n = e(v.find("input[name='" + l + "']")), b = t._getErrorMessage(v, n, a[m], a, m, r, t._minCheckbox);
                    break;
                case "equals":
                    b = t._getErrorMessage(v, n, a[m], a, m, r, t._equals);
                    break;
                case "funcCall":
                    b = t._getErrorMessage(v, n, a[m], a, m, r, t._funcCall);
                    break;
                case "creditCard":
                    b = t._getErrorMessage(v, n, a[m], a, m, r, t._creditCard);
                    break;
                case "condRequired":
                    b = t._getErrorMessage(v, n, a[m], a, m, r, t._condRequired), b !== undefined && (p = !0);
                    break;
                default:
                }
                var S = !1;
                if (typeof b == "object") switch (b.status) {
                case "_break":
                    S = !0;
                    break;
                case "_error":
                    b = b.message;
                    break;
                case "_error_no_prompt":
                    return !0;
                default:
                }
                if (S) break;
                typeof b == "string" && (c += b + "<br/>", r.isError = !0, g++)
            }!p && !n.val() && n.val().length < 1 && (r.isError = !1);
            var x = n.prop("type"),
                T = n.data("promptPosition") || r.promptPosition;
            (x == "radio" || x == "checkbox") && v.find("input[name='" + l + "']").size() > 1 && (T === "inline" ? n = e(v.find("input[name='" + l + "'][type!=hidden]:last")) : n = e(v.find("input[name='" + l + "'][type!=hidden]:first")), r.showArrow = !1), n.is(":hidden") && r.prettySelect && (n = v.find("#" + r.usePrefix + t._jqSelector(n.attr("id")) + r.useSuffix)), r.isError && r.showPrompts ? t._showPrompt(n, c, h, !1, r) : f || t._closePrompt(n), f || n.trigger("jqv.field.result", [n, r.isError, c]);
            var N = e.inArray(n[0], r.InvalidFields);
            return N == -1 ? r.isError && r.InvalidFields.push(n[0]) : r.isError || r.InvalidFields.splice(N, 1), t._handleStatusCssClasses(n, r), r.isError && r.onFieldFailure && r.onFieldFailure(n), !r.isError && r.onFieldSuccess && r.onFieldSuccess(n), r.isError
        },
        _handleStatusCssClasses: function (e, t) {
            t.addSuccessCssClassToField && e.removeClass(t.addSuccessCssClassToField), t.addFailureCssClassToField && e.removeClass(t.addFailureCssClassToField), t.addSuccessCssClassToField && !t.isError && e.addClass(t.addSuccessCssClassToField), t.addFailureCssClassToField && t.isError && e.addClass(t.addFailureCssClassToField)
        },
        _getErrorMessage: function (n, r, i, s, o, u, a) {
            var f = jQuery.inArray(i, s);
            if (i === "custom" || i === "funcCall") {
                var l = s[f + 1];
                i = i + "[" + l + "]", delete s[f]
            }
            var c = i,
                h = r.attr("data-validation-engine") ? r.attr("data-validation-engine") : r.attr("class"),
                p = h.split(" "),
                d;
            i == "future" || i == "past" || i == "maxCheckbox" || i == "minCheckbox" ? d = a(n, r, s, o, u) : d = a(r, s, o, u);
            if (d != undefined) {
                var v = t._getCustomErrorMessage(e(r), p, c, u);
                v && (d = v)
            }
            return d
        },
        _getCustomErrorMessage: function (e, n, r, i) {
            var s = !1,
                o = t._validityProp[r];
            if (o != undefined) {
                s = e.attr("data-errormessage-" + o);
                if (s != undefined) return s
            }
            s = e.attr("data-errormessage");
            if (s != undefined) return s;
            var u = "#" + e.attr("id");
            if (typeof i.custom_error_messages[u] != "undefined" && typeof i.custom_error_messages[u][r] != "undefined") s = i.custom_error_messages[u][r].message;
            else if (n.length > 0)
                for (var a = 0; a < n.length && n.length > 0; a++) {
                    var f = "." + n[a];
                    if (typeof i.custom_error_messages[f] != "undefined" && typeof i.custom_error_messages[f][r] != "undefined") {
                        s = i.custom_error_messages[f][r].message;
                        break
                    }
                }
            return !s && typeof i.custom_error_messages[r] != "undefined" && typeof i.custom_error_messages[r]["message"] != "undefined" && (s = i.custom_error_messages[r].message), s
        },
        _validityProp: {
            required: "value-missing",
            custom: "custom-error",
            groupRequired: "value-missing",
            ajax: "custom-error",
            minSize: "range-underflow",
            maxSize: "range-overflow",
            min: "range-underflow",
            max: "range-overflow",
            past: "type-mismatch",
            future: "type-mismatch",
            dateRange: "type-mismatch",
            dateTimeRange: "type-mismatch",
            maxCheckbox: "range-overflow",
            minCheckbox: "range-underflow",
            equals: "pattern-mismatch",
            funcCall: "custom-error",
            creditCard: "pattern-mismatch",
            condRequired: "value-missing"
        },
        _required: function (t, n, r, i, s) {
            switch (t.prop("type")) {
            case "text":
            case "password":
            case "textarea":
            case "file":
            case "select-one":
            case "select-multiple":
            default:
                var o = e.trim(t.val()),
                    u = e.trim(t.attr("data-validation-placeholder")),
                    a = e.trim(t.attr("placeholder"));
                if (!o || u && o == u || a && o == a) return i.allrules[n[r]].alertText;
                break;
            case "radio":
            case "checkbox":
                if (s) {
                    if (!t.attr("checked")) return i.allrules[n[r]].alertTextCheckboxMultiple;
                    break
                }
                var f = t.closest("form, .validationEngineContainer"),
                    l = t.attr("name");
                if (f.find("input[name='" + l + "']:checked").size() == 0) return f.find("input[name='" + l + "']:visible").size() == 1 ? i.allrules[n[r]].alertTextCheckboxe : i.allrules[n[r]].alertTextCheckboxMultiple
            }
        },
        _groupRequired: function (n, r, i, s) {
            var o = "[" + s.validateAttribute + "*=" + r[i + 1] + "]",
                u = !1;
            n.closest("form, .validationEngineContainer").find(o).each(function () {
                if (!t._required(e(this), r, i, s)) return u = !0, !1
            });
            if (!u) return s.allrules[r[i]].alertText
        },
        _custom: function (e, t, n, r) {
            var i = t[n + 1],
                s = r.allrules[i],
                o;
            if (!s) {
                alert("jqv:custom rule not found - " + i);
                return
            }
            if (s.regex) {
                var u = s.regex;
                if (!u) {
                    alert("jqv:custom regex not found - " + i);
                    return
                }
                var a = new RegExp(u);
                if (!a.test(e.val())) return r.allrules[i].alertText
            } else {
                if (!s.func) {
                    alert("jqv:custom type not allowed " + i);
                    return
                }
                o = s.func;
                if (typeof o != "function") {
                    alert("jqv:custom parameter 'function' is no function - " + i);
                    return
                }
                if (!o(e, t, n, r)) return r.allrules[i].alertText
            }
        },
        _funcCall: function (e, t, n, r) {
            var i = t[n + 1],
                s;
            if (i.indexOf(".") > -1) {
                var o = i.split("."),
                    u = window;
                while (o.length) u = u[o.shift()];
                s = u
            } else s = window[i] || r.customFunctions[i]; if (typeof s == "function") return s(e, t, n, r)
        },
        _equals: function (t, n, r, i) {
            var s = n[r + 1];
            if (t.val() != e("#" + s).val()) return i.allrules.equals.alertText
        },
        _maxSize: function (e, t, n, r) {
            var i = t[n + 1],
                s = e.val().length;
            if (s > i) {
                var o = r.allrules.maxSize;
                return o.alertText + i + o.alertText2
            }
        },
        _minSize: function (e, t, n, r) {
            var i = t[n + 1],
                s = e.val().length;
            if (s < i) {
                var o = r.allrules.minSize;
                return o.alertText + i + o.alertText2
            }
        },
        _min: function (e, t, n, r) {
            var i = parseFloat(t[n + 1]),
                s = parseFloat(e.val());
            if (s < i) {
                var o = r.allrules.min;
                return o.alertText2 ? o.alertText + i + o.alertText2 : o.alertText + i
            }
        },
        _max: function (e, t, n, r) {
            var i = parseFloat(t[n + 1]),
                s = parseFloat(e.val());
            if (s > i) {
                var o = r.allrules.max;
                return o.alertText2 ? o.alertText + i + o.alertText2 : o.alertText + i
            }
        },
        _past: function (n, r, i, s, o) {
            var u = i[s + 1],
                a = e(n.find("input[name='" + u.replace(/^#+/, "") + "']")),
                f;
            if (u.toLowerCase() == "now") f = new Date;
            else if (undefined != a.val()) {
                if (a.is(":disabled")) return;
                f = t._parseDate(a.val())
            } else f = t._parseDate(u);
            var l = t._parseDate(r.val());
            if (l > f) {
                var c = o.allrules.past;
                return c.alertText2 ? c.alertText + t._dateToString(f) + c.alertText2 : c.alertText + t._dateToString(f)
            }
        },
        _future: function (n, r, i, s, o) {
            var u = i[s + 1],
                a = e(n.find("input[name='" + u.replace(/^#+/, "") + "']")),
                f;
            if (u.toLowerCase() == "now") f = new Date;
            else if (undefined != a.val()) {
                if (a.is(":disabled")) return;
                f = t._parseDate(a.val())
            } else f = t._parseDate(u);
            var l = t._parseDate(r.val());
            if (l < f) {
                var c = o.allrules.future;
                return c.alertText2 ? c.alertText + t._dateToString(f) + c.alertText2 : c.alertText + t._dateToString(f)
            }
        },
        _isDate: function (e) {
            var t = new RegExp(/^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$|^(?:(?:(?:0?[13578]|1[02])(\/|-)31)|(?:(?:0?[1,3-9]|1[0-2])(\/|-)(?:29|30)))(\/|-)(?:[1-9]\d\d\d|\d[1-9]\d\d|\d\d[1-9]\d|\d\d\d[1-9])$|^(?:(?:0?[1-9]|1[0-2])(\/|-)(?:0?[1-9]|1\d|2[0-8]))(\/|-)(?:[1-9]\d\d\d|\d[1-9]\d\d|\d\d[1-9]\d|\d\d\d[1-9])$|^(0?2(\/|-)29)(\/|-)(?:(?:0[48]00|[13579][26]00|[2468][048]00)|(?:\d\d)?(?:0[48]|[2468][048]|[13579][26]))$/);
            return t.test(e)
        },
        _isDateTime: function (e) {
            var t = new RegExp(/^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])\s+(1[012]|0?[1-9]){1}:(0?[1-5]|[0-6][0-9]){1}:(0?[0-6]|[0-6][0-9]){1}\s+(am|pm|AM|PM){1}$|^(?:(?:(?:0?[13578]|1[02])(\/|-)31)|(?:(?:0?[1,3-9]|1[0-2])(\/|-)(?:29|30)))(\/|-)(?:[1-9]\d\d\d|\d[1-9]\d\d|\d\d[1-9]\d|\d\d\d[1-9])$|^((1[012]|0?[1-9]){1}\/(0?[1-9]|[12][0-9]|3[01]){1}\/\d{2,4}\s+(1[012]|0?[1-9]){1}:(0?[1-5]|[0-6][0-9]){1}:(0?[0-6]|[0-6][0-9]){1}\s+(am|pm|AM|PM){1})$/);
            return t.test(e)
        },
        _dateCompare: function (e, t) {
            return new Date(e.toString()) < new Date(t.toString())
        },
        _dateRange: function (e, n, r, i) {
            if (!i.firstOfGroup[0].value && i.secondOfGroup[0].value || i.firstOfGroup[0].value && !i.secondOfGroup[0].value) return i.allrules[n[r]].alertText + i.allrules[n[r]].alertText2;
            if (!t._isDate(i.firstOfGroup[0].value) || !t._isDate(i.secondOfGroup[0].value)) return i.allrules[n[r]].alertText + i.allrules[n[r]].alertText2;
            if (!t._dateCompare(i.firstOfGroup[0].value, i.secondOfGroup[0].value)) return i.allrules[n[r]].alertText + i.allrules[n[r]].alertText2
        },
        _dateTimeRange: function (e, n, r, i) {
            if (!i.firstOfGroup[0].value && i.secondOfGroup[0].value || i.firstOfGroup[0].value && !i.secondOfGroup[0].value) return i.allrules[n[r]].alertText + i.allrules[n[r]].alertText2;
            if (!t._isDateTime(i.firstOfGroup[0].value) || !t._isDateTime(i.secondOfGroup[0].value)) return i.allrules[n[r]].alertText + i.allrules[n[r]].alertText2;
            if (!t._dateCompare(i.firstOfGroup[0].value, i.secondOfGroup[0].value)) return i.allrules[n[r]].alertText + i.allrules[n[r]].alertText2
        },
        _maxCheckbox: function (e, t, n, r, i) {
            var s = n[r + 1],
                o = t.attr("name"),
                u = e.find("input[name='" + o + "']:checked").size();
            if (u > s) return i.showArrow = !1, i.allrules.maxCheckbox.alertText2 ? i.allrules.maxCheckbox.alertText + " " + s + " " + i.allrules.maxCheckbox.alertText2 : i.allrules.maxCheckbox.alertText
        },
        _minCheckbox: function (e, t, n, r, i) {
            var s = n[r + 1],
                o = t.attr("name"),
                u = e.find("input[name='" + o + "']:checked").size();
            if (u < s) return i.showArrow = !1, i.allrules.minCheckbox.alertText + " " + s + " " + i.allrules.minCheckbox.alertText2
        },
        _creditCard: function (e, t, n, r) {
            var i = !1,
                s = e.val().replace(/ +/g, "").replace(/-+/g, ""),
                o = s.length;
            if (o >= 14 && o <= 16 && parseInt(s) > 0) {
                var u = 0,
                    n = o - 1,
                    a = 1,
                    f, l = new String;
                do f = parseInt(s.charAt(n)), l += a++ % 2 == 0 ? f * 2 : f; while (--n >= 0);
                for (n = 0; n < l.length; n++) u += parseInt(l.charAt(n));
                i = u % 10 == 0
            }
            if (!i) return r.allrules.creditCard.alertText
        },
        _ajax: function (n, r, i, s) {
            var o = r[i + 1],
                u = s.allrules[o],
                a = u.extraData,
                f = u.extraDataDynamic,
                l = {
                    fieldId: n.attr("id"),
                    fieldValue: n.val()
                };
            if (typeof a == "object") e.extend(l, a);
            else if (typeof a == "string") {
                var c = a.split("&");
                for (var i = 0; i < c.length; i++) {
                    var h = c[i].split("=");
                    h[0] && h[0] && (l[h[0]] = h[1])
                }
            }
            if (f) {
                var p = [],
                    d = String(f).split(",");
                for (var i = 0; i < d.length; i++) {
                    var v = d[i];
                    if (e(v).length) {
                        var m = n.closest("form, .validationEngineContainer").find(v).val(),
                            g = v.replace("#", "") + "=" + escape(m);
                        l[v.replace("#", "")] = m
                    }
                }
            }
            s.eventTrigger == "field" && delete s.ajaxValidCache[n.attr("id")];
            if (!s.isError && !t._checkAjaxFieldStatus(n.attr("id"), s)) return e.ajax({
                type: s.ajaxFormValidationMethod,
                url: u.url,
                cache: !1,
                dataType: "json",
                data: l,
                field: n,
                rule: u,
                methods: t,
                options: s,
                beforeSend: function () {},
                error: function (e, n) {
                    t._ajaxError(e, n)
                },
                success: function (r) {
                    var i = r[0],
                        o = e("#" + i).eq(0);
                    if (o.length == 1) {
                        var a = r[1],
                            f = r[2];
                        if (!a) {
                            s.ajaxValidCache[i] = !1, s.isError = !0;
                            if (f) {
                                if (s.allrules[f]) {
                                    var l = s.allrules[f].alertText;
                                    l && (f = l)
                                }
                            } else f = u.alertText;
                            s.showPrompts && t._showPrompt(o, f, "", !0, s)
                        } else {
                            s.ajaxValidCache[i] = !0;
                            if (f) {
                                if (s.allrules[f]) {
                                    var l = s.allrules[f].alertTextOk;
                                    l && (f = l)
                                }
                            } else f = u.alertTextOk;
                            s.showPrompts && (f ? t._showPrompt(o, f, "pass", !0, s) : t._closePrompt(o)), s.eventTrigger == "submit" && n.closest("form").submit()
                        }
                    }
                    o.trigger("jqv.field.result", [o, s.isError, f])
                }
            }), u.alertTextLoad
        },
        _ajaxError: function (e, t) {
            e.status == 0 && t == null ? alert("The page is not served from a server! ajax call failed") : typeof console != "undefined" && console.log("Ajax error: " + e.status + " " + t)
        },
        _dateToString: function (e) {
            return e.getFullYear() + "-" + (e.getMonth() + 1) + "-" + e.getDate()
        },
        _parseDate: function (e) {
            var t = e.split("-");
            return t == e && (t = e.split("/")), t == e ? (t = e.split("."), new Date(t[2], t[1] - 1, t[0])) : new Date(t[0], t[1] - 1, t[2])
        },
        _showPrompt: function (n, r, i, s, o, u) {
            var a = t._getPrompt(n);
            u && (a = !1), e.trim(r) && (a ? t._updatePrompt(n, a, r, i, s, o) : t._buildPrompt(n, r, i, s, o))
        },
        _buildPrompt: function (n, r, i, s, o) {
            var u = e("<div>");
            u.addClass(t._getClassName(n.attr("id")) + "formError"), u.addClass("parentForm" + t._getClassName(n.closest("form, .validationEngineContainer").attr("id"))), u.addClass("formError");
            switch (i) {
            case "pass":
                u.addClass("greenPopup");
                break;
            case "load":
                u.addClass("blackPopup");
                break;
            default:
            }
            s && u.addClass("ajaxed");
            var a = e("<div>").addClass("formErrorContent").html(r).appendTo(u),
                f = n.data("promptPosition") || o.promptPosition;
            if (o.showArrow) {
                var l = e("<div>").addClass("formErrorArrow");
                if (typeof f == "string") {
                    var c = f.indexOf(":");
                    c != -1 && (f = f.substring(0, c))
                }
                switch (f) {
                case "bottomLeft":
                case "bottomRight":
                    u.find(".formErrorContent").before(l), l.addClass("formErrorArrowBottom").html('<div class="line1"><!-- --></div><div class="line2"><!-- --></div><div class="line3"><!-- --></div><div class="line4"><!-- --></div><div class="line5"><!-- --></div><div class="line6"><!-- --></div><div class="line7"><!-- --></div><div class="line8"><!-- --></div><div class="line9"><!-- --></div><div class="line10"><!-- --></div>');
                    break;
                case "topLeft":
                case "topRight":
                    l.html('<div class="line10"><!-- --></div><div class="line9"><!-- --></div><div class="line8"><!-- --></div><div class="line7"><!-- --></div><div class="line6"><!-- --></div><div class="line5"><!-- --></div><div class="line4"><!-- --></div><div class="line3"><!-- --></div><div class="line2"><!-- --></div><div class="line1"><!-- --></div>'), u.append(l)
                }
            }
            o.addPromptClass && u.addClass(o.addPromptClass);
            var h = n.attr("data-required-class");
            if (h !== undefined) u.addClass(h);
            else if (o.prettySelect && e("#" + n.attr("id")).next().is("select")) {
                var p = e("#" + n.attr("id").substr(o.usePrefix.length).substring(o.useSuffix.length)).attr("data-required-class");
                p !== undefined && u.addClass(p)
            }
            u.css({
                opacity: 0
            }), f === "inline" ? (u.addClass("inline"), typeof n.attr("data-prompt-target") != "undefined" && e("#" + n.attr("data-prompt-target")).length > 0 ? u.appendTo(e("#" + n.attr("data-prompt-target"))) : n.after(u)) : n.before(u);
            var c = t._calculatePosition(n, u, o);
            return u.css({
                position: f === "inline" ? "relative" : "absolute",
                top: c.callerTopPosition,
                left: c.callerleftPosition,
                marginTop: c.marginTopSize,
                opacity: 0
            }).data("callerField", n), o.autoHidePrompt && setTimeout(function () {
                u.animate({
                    opacity: 0
                }, function () {
                    u.closest(".formErrorOuter").remove(), u.remove()
                })
            }, o.autoHideDelay), u.animate({
                opacity: .87
            })
        },
        _updatePrompt: function (e, n, r, i, s, o, u) {
            if (n) {
                typeof i != "undefined" && (i == "pass" ? n.addClass("greenPopup") : n.removeClass("greenPopup"), i == "load" ? n.addClass("blackPopup") : n.removeClass("blackPopup")), s ? n.addClass("ajaxed") : n.removeClass("ajaxed"), n.find(".formErrorContent").html(r);
                var a = t._calculatePosition(e, n, o),
                    f = {
                        top: a.callerTopPosition,
                        left: a.callerleftPosition,
                        marginTop: a.marginTopSize
                    };
                u ? n.css(f) : n.animate(f)
            }
        },
        _closePrompt: function (e) {
            var n = t._getPrompt(e);
            n && n.fadeTo("fast", 0, function () {
                n.parent(".formErrorOuter").remove(), n.remove()
            })
        },
        closePrompt: function (e) {
            return t._closePrompt(e)
        },
        _getPrompt: function (n) {
            var r = e(n).closest("form, .validationEngineContainer").attr("id"),
                i = t._getClassName(n.attr("id")) + "formError",
                s = e("." + t._escapeExpression(i) + ".parentForm" + r)[0];
            if (s) return e(s)
        },
        _escapeExpression: function (e) {
            return e.replace(/([#;&,\.\+\*\~':"\!\^$\[\]\(\)=>\|])/g, "\\$1")
        },
        isRTL: function (t) {
            var n = e(document),
                r = e("body"),
                i = t && t.hasClass("rtl") || t && (t.attr("dir") || "").toLowerCase() === "rtl" || n.hasClass("rtl") || (n.attr("dir") || "").toLowerCase() === "rtl" || r.hasClass("rtl") || (r.attr("dir") || "").toLowerCase() === "rtl";
            return Boolean(i)
        },
        _calculatePosition: function (e, t, n) {
            var r, i, s, o = e.width(),
                u = e.position().left,
                a = e.position().top,
                f = e.height(),
                l = t.height();
            r = i = 0, s = -l;
            var c = e.data("promptPosition") || n.promptPosition,
                h = "",
                p = "",
                d = 0,
                v = 0;
            typeof c == "string" && c.indexOf(":") != -1 && (h = c.substring(c.indexOf(":") + 1), c = c.substring(0, c.indexOf(":")), h.indexOf(",") != -1 && (p = h.substring(h.indexOf(",") + 1), h = h.substring(0, h.indexOf(",")), v = parseInt(p), isNaN(v) && (v = 0)), d = parseInt(h), isNaN(h) && (h = 0));
            switch (c) {
                default:
            case "topRight":
                i += u + o - 30,
                r += a;
                break;
            case "topLeft":
                r += a, i += u;
                break;
            case "centerRight":
                r = a + 4, s = 0, i = u + e.outerWidth(!0) + 5;
                break;
            case "centerLeft":
                i = u - (t.width() + 2), r = a + 4, s = 0;
                break;
            case "bottomLeft":
                r = a + e.height() + 5, s = 0, i = u;
                break;
            case "bottomRight":
                i = u + o - 30, r = a + e.height() + 5, s = 0;
                break;
            case "inline":
                i = 0, r = 0, s = 0
            }
            return i += d, r += v, {
                callerTopPosition: r + "px",
                callerleftPosition: i + "px",
                marginTopSize: s + "px"
            }
        },
        _saveOptions: function (t, n) {
            if (e.validationEngineLanguage) var r = e.validationEngineLanguage.allRules;
            else e.error("jQuery.validationEngine rules are not loaded, plz add localization files to the page");
            e.validationEngine.defaults.allrules = r;
            var i = e.extend(!0, {}, e.validationEngine.defaults, n);
            return t.data("jqv", i), i
        },
        _getClassName: function (e) {
            if (e) return e.replace(/:/g, "_").replace(/\./g, "_")
        },
        _jqSelector: function (e) {
            return e.replace(/([;&,\.\+\*\~':"\!\^#$%@\[\]\(\)=>\|])/g, "\\$1")
        },
        _condRequired: function (e, n, r, i) {
            var s, o;
            for (s = r + 1; s < n.length; s++) {
                o = jQuery("#" + n[s]).first();
                if (o.length && t._required(o, ["required"], 0, i, true) == undefined) return t._required(e, ["required"], 0, i)
            }
        },
        _submitButtonClick: function (t) {
            var n = e(this),
                r = n.closest("form, .validationEngineContainer");
            r.data("jqv_submitButton", n.attr("id"))
        }
    };
    e.fn.validationEngine = function (n) {
        var r = e(this);
        if (!r[0]) return r;
        if (typeof n == "string" && n.charAt(0) != "_" && t[n]) return n != "showPrompt" && n != "hide" && n != "hideAll" && t.init.apply(r), t[n].apply(r, Array.prototype.slice.call(arguments, 1));
        if (typeof n == "object" || !n) return t.init.apply(r, arguments), t.attach.apply(r);
        e.error("Method " + n + " does not exist in jQuery.validationEngine")
    }, e.validationEngine = {
        fieldIdCounter: 0,
        defaults: {
            validationEventTrigger: "blur",
            scroll: !0,
            focusFirstField: !0,
            showPrompts: !0,
            validateNonVisibleFields: !1,
            promptPosition: "topRight",
            bindMethod: "bind",
            inlineAjax: !1,
            ajaxFormValidation: !1,
            ajaxFormValidationURL: !1,
            ajaxFormValidationMethod: "get",
            onAjaxFormComplete: e.noop,
            onBeforeAjaxFormValidation: e.noop,
            onValidationComplete: !1,
            doNotShowAllErrosOnSubmit: !1,
            custom_error_messages: {},
            binded: !0,
            showArrow: !1,
            isError: !1,
            maxErrorsPerField: !1,
            ajaxValidCache: {},
            autoPositionUpdate: !1,
            InvalidFields: [],
            onFieldSuccess: !1,
            onFieldFailure: !1,
            onSuccess: !1,
            onFailure: !1,
            validateAttribute: "class",
            addSuccessCssClassToField: "",
            addFailureCssClassToField: "",
            autoHidePrompt: !1,
            autoHideDelay: 1e4,
            fadeDuration: .3,
            prettySelect: !1,
            addPromptClass: "",
            usePrefix: "",
            useSuffix: "",
            showOneMessage: !1
        }
    }, e(function () {
        e.validationEngine.defaults.promptPosition = t.isRTL() ? "topLeft" : "topRight"
    })
}(jQuery),
function () {
    var e = function (e, t) {
        return function () {
            return e.apply(t, arguments)
        }
    };
    this.CalendarEvent = function () {
        function t(t, n) {
            var r;
            this.container = t, this.makeFullCalendarEventObject = e(this.makeFullCalendarEventObject, this), this.handleDoubleClick = e(this.handleDoubleClick, this), this.finalizeEvent = e(this.finalizeEvent, this), this.handleInputBlur = e(this.handleInputBlur, this), this.handleInputKeyup = e(this.handleInputKeyup, this), this.container.bind("dblclick", this.handleDoubleClick), n != null ? (r = this.container.find("input"), r.focus(), r.bind("keyup", this.handleInputKeyup), r.bind("blur", this.handleInputBlur)) : this.makeFullCalendarEventObject()
        }
        return t.prototype.handleInputKeyup = function (e) {
            var t;
            t = $(e.target);
            if (e.keyCode === 13) return t.val().length === 0 ? this.container.remove() : this.finalizeEvent(t.val())
        }, t.prototype.handleInputBlur = function (e) {
            var t;
            return t = $(e.target), t.val().length === 0 ? this.container.remove() : this.finalizeEvent(t.val())
        }, t.prototype.finalizeEvent = function (e) {
            return this.container.find("a").html(e), this.makeFullCalendarEventObject()
        }, t.prototype.handleDoubleClick = function (e) {
            var t, n, r, i = this;
            return t = $("<input type='text'>"), n = $(e.target), r = n.text(), t.val(r), n.html(t), t.focus(), t.bind("keyup", function (e) {
                if (e.keyCode === 13) return t.val().length > 0 ? (n.html(t.val()), i.makeFullCalendarEventObject()) : n.html(r)
            }), t.bind("blur", function (e) {
                return t.val().length > 0 ? (n.html(t.val()), i.makeFullCalendarEventObject()) : n.html(r)
            })
        }, t.prototype.makeFullCalendarEventObject = function () {
            var e, t;
            return t = $(this.container), e = {
                title: $.trim(t.text())
            }, t.data("eventObject", e), t.draggable({
                zIndex: 999,
                revert: !0,
                revertDuration: 0
            })
        }, t
    }(), this.CalendarEvents = function () {
        function t(t) {
            this.container = t, this.handleAddLink = e(this.handleAddLink, this), this.addLink = this.container.find("#add-event"), this.container.find("a.external-event").each(function () {
                return new CalendarEvent($(this))
            }), this.template = "<li><a class='external-event'><input type='text'></a></li>", this.addLink.bind("click", this.handleAddLink)
        }
        return t.prototype.handleAddLink = function () {
            var e;
            return e = $(this.template), e.insertBefore(this.addLink.parent()), new CalendarEvent(e, !0)
        }, t
    }()
}.call(this),
function (e) {
    function t(e, t, n, r) {
        var i = n.lang();
        return i[e].call ? i[e](n, r) : i[e][t]
    }

    function n(e, t) {
        return function (n) {
            return u(e.call(this, n), t)
        }
    }

    function r(e) {
        return function (t) {
            var n = e.call(this, t);
            return n + this.lang().ordinal(n)
        }
    }

    function i(e, t, n) {
        this._d = e, this._isUTC = !! t, this._a = e._a || null, this._lang = n || !1
    }

    function s(e) {
        var t = this._data = {}, n = e.years || e.y || 0,
            r = e.months || e.M || 0,
            i = e.weeks || e.w || 0,
            s = e.days || e.d || 0,
            u = e.hours || e.h || 0,
            a = e.minutes || e.m || 0,
            f = e.seconds || e.s || 0,
            l = e.milliseconds || e.ms || 0;
        this._milliseconds = l + f * 1e3 + a * 6e4 + u * 36e5, this._days = s + i * 7, this._months = r + n * 12, t.milliseconds = l % 1e3, f += o(l / 1e3), t.seconds = f % 60, a += o(f / 60), t.minutes = a % 60, u += o(a / 60), t.hours = u % 24, s += o(u / 24), s += i * 7, t.days = s % 30, r += o(s / 30), t.months = r % 12, n += o(r / 12), t.years = n, this._lang = !1
    }

    function o(e) {
        return e < 0 ? Math.ceil(e) : Math.floor(e)
    }

    function u(e, t) {
        var n = e + "";
        while (n.length < t) n = "0" + n;
        return n
    }

    function a(e, t, n) {
        var r = t._milliseconds,
            i = t._days,
            s = t._months,
            o;
        r && e._d.setTime(+e + r * n), i && e.date(e.date() + i * n), s && (o = e.date(), e.date(1).month(e.month() + s * n).date(Math.min(o, e.daysInMonth())))
    }

    function f(e) {
        return Object.prototype.toString.call(e) === "[object Array]"
    }

    function l(e, t) {
        var n = Math.min(e.length, t.length),
            r = Math.abs(e.length - t.length),
            i = 0,
            s;
        for (s = 0; s < n; s++)~~ e[s] !== ~~t[s] && i++;
        return i + r
    }

    function c(e, t, n, r) {
        var i, s, o = [];
        for (i = 0; i < 7; i++) o[i] = e[i] = e[i] == null ? i === 2 ? 1 : 0 : e[i];
        return e[7] = o[7] = t, e[8] != null && (o[8] = e[8]), e[3] += n || 0, e[4] += r || 0, s = new Date(0), t ? (s.setUTCFullYear(e[0], e[1], e[2]), s.setUTCHours(e[3], e[4], e[5], e[6])) : (s.setFullYear(e[0], e[1], e[2]), s.setHours(e[3], e[4], e[5], e[6])), s._a = o, s
    }

    function h(e, t) {
        var n, r, i = [];
        !t && D && (t = require("./lang/" + e));
        for (n = 0; n < P.length; n++) t[P[n]] = t[P[n]] || M.en[P[n]];
        for (n = 0; n < 12; n++) r = k([2e3, n]), i[n] = new RegExp("^" + (t.months[n] || t.months(r, "")) + "|^" + (t.monthsShort[n] || t.monthsShort(r, "")).replace(".", ""), "i");
        return t.monthsParse = t.monthsParse || i, M[e] = t, t
    }

    function p(e) {
        var t = typeof e == "string" && e || e && e._lang || null;
        return t ? M[t] || h(t) : k
    }

    function d(e) {
        return e.match(/\[.*\]/) ? e.replace(/^\[|\]$/g, "") : e.replace(/\\/g, "")
    }

    function v(e) {
        var t = e.match(B),
            n, r;
        for (n = 0, r = t.length; n < r; n++) tt[t[n]] ? t[n] = tt[t[n]] : t[n] = d(t[n]);
        return function (i) {
            var s = "";
            for (n = 0; n < r; n++) s += typeof t[n].call == "function" ? t[n].call(i, e) : t[n];
            return s
        }
    }

    function m(e, t) {
        function n(t) {
            return e.lang().longDateFormat[t] || t
        }
        var r = 5;
        while (r-- && j.test(t)) t = t.replace(j, n);
        return Y[t] || (Y[t] = v(t)), Y[t](e)
    }

    function g(e) {
        switch (e) {
        case "DDDD":
            return R;
        case "YYYY":
            return U;
        case "S":
        case "SS":
        case "SSS":
        case "DDD":
            return q;
        case "MMM":
        case "MMMM":
        case "dd":
        case "ddd":
        case "dddd":
        case "a":
        case "A":
            return z;
        case "Z":
        case "ZZ":
            return W;
        case "T":
            return X;
        case "MM":
        case "DD":
        case "YY":
        case "HH":
        case "hh":
        case "mm":
        case "ss":
        case "M":
        case "D":
        case "d":
        case "H":
        case "h":
        case "m":
        case "s":
            return I;
        default:
            return new RegExp(e.replace("\\", ""))
        }
    }

    function y(e, t, n, r) {
        var i, s;
        switch (e) {
        case "M":
        case "MM":
            n[1] = t == null ? 0 : ~~t - 1;
            break;
        case "MMM":
        case "MMMM":
            for (i = 0; i < 12; i++)
                if (p().monthsParse[i].test(t)) {
                    n[1] = i, s = !0;
                    break
                }
            s || (n[8] = !1);
            break;
        case "D":
        case "DD":
        case "DDD":
        case "DDDD":
            t != null && (n[2] = ~~t);
            break;
        case "YY":
            n[0] = ~~t + (~~t > 70 ? 1900 : 2e3);
            break;
        case "YYYY":
            n[0] = ~~Math.abs(t);
            break;
        case "a":
        case "A":
            r.isPm = (t + "").toLowerCase() === "pm";
            break;
        case "H":
        case "HH":
        case "h":
        case "hh":
            n[3] = ~~t;
            break;
        case "m":
        case "mm":
            n[4] = ~~t;
            break;
        case "s":
        case "ss":
            n[5] = ~~t;
            break;
        case "S":
        case "SS":
        case "SSS":
            n[6] = ~~ (("0." + t) * 1e3);
            break;
        case "Z":
        case "ZZ":
            r.isUTC = !0, i = (t + "").match(K), i && i[1] && (r.tzh = ~~i[1]), i && i[2] && (r.tzm = ~~i[2]), i && i[0] === "+" && (r.tzh = -r.tzh, r.tzm = -r.tzm)
        }
        t == null && (n[8] = !1)
    }

    function b(e, t) {
        var n = [0, 0, 1, 0, 0, 0, 0],
            r = {
                tzh: 0,
                tzm: 0
            }, i = t.match(B),
            s, o;
        for (s = 0; s < i.length; s++) o = (g(i[s]).exec(e) || [])[0], o && (e = e.slice(e.indexOf(o) + o.length)), tt[i[s]] && y(i[s], o, n, r);
        return r.isPm && n[3] < 12 && (n[3] += 12), r.isPm === !1 && n[3] === 12 && (n[3] = 0), c(n, r.isUTC, r.tzh, r.tzm)
    }

    function w(e, t) {
        var n, r = e.match(F) || [],
            s, o = 99,
            u, a, f;
        for (u = 0; u < t.length; u++) a = b(e, t[u]), s = m(new i(a), t[u]).match(F) || [], f = l(r, s), f < o && (o = f, n = a);
        return n
    }

    function E(e) {
        var t = "YYYY-MM-DDT",
            n;
        if (V.exec(e)) {
            for (n = 0; n < 4; n++)
                if (J[n][1].exec(e)) {
                    t += J[n][0];
                    break
                }
            return W.exec(e) ? b(e, t + " Z") : b(e, t)
        }
        return new Date(e)
    }

    function S(e, t, n, r, i) {
        var s = i.relativeTime[e];
        return typeof s == "function" ? s(t || 1, !! n, e, r) : s.replace(/%d/i, t || 1)
    }

    function x(e, t, n) {
        var r = A(Math.abs(e) / 1e3),
            i = A(r / 60),
            s = A(i / 60),
            o = A(s / 24),
            u = A(o / 365),
            a = r < 45 && ["s", r] || i === 1 && ["m"] || i < 45 && ["mm", i] || s === 1 && ["h"] || s < 22 && ["hh", s] || o === 1 && ["d"] || o <= 25 && ["dd", o] || o <= 45 && ["M"] || o < 345 && ["MM", A(o / 30)] || u === 1 && ["y"] || ["yy", u];
        return a[2] = t, a[3] = e > 0, a[4] = n, S.apply({}, a)
    }

    function T(e, t) {
        k.fn[e] = function (e) {
            var n = this._isUTC ? "UTC" : "";
            return e != null ? (this._d["set" + n + t](e), this) : this._d["get" + n + t]()
        }
    }

    function N(e) {
        k.duration.fn[e] = function () {
            return this._data[e]
        }
    }

    function C(e, t) {
        k.duration.fn["as" + e] = function () {
            return +this / t
        }
    }
    var k, L = "1.7.2",
        A = Math.round,
        O, M = {}, _ = "en",
        D = typeof module != "undefined" && module.exports,
        P = "months|monthsShort|weekdays|weekdaysShort|weekdaysMin|longDateFormat|calendar|relativeTime|ordinal|meridiem".split("|"),
        H = /^\/?Date\((\-?\d+)/i,
        B = /(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|YYYY|YY|a|A|hh?|HH?|mm?|ss?|SS?S?|zz?|ZZ?|.)/g,
        j = /(\[[^\[]*\])|(\\)?(LT|LL?L?L?)/g,
        F = /([0-9a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+)/gi,
        I = /\d\d?/,
        q = /\d{1,3}/,
        R = /\d{3}/,
        U = /\d{1,4}/,
        z = /[0-9a-z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+/i,
        W = /Z|[\+\-]\d\d:?\d\d/i,
        X = /T/i,
        V = /^\s*\d{4}-\d\d-\d\d(T(\d\d(:\d\d(:\d\d(\.\d\d?\d?)?)?)?)?([\+\-]\d\d:?\d\d)?)?/,
        $ = "YYYY-MM-DDTHH:mm:ssZ",
        J = [
            ["HH:mm:ss.S", /T\d\d:\d\d:\d\d\.\d{1,3}/],
            ["HH:mm:ss", /T\d\d:\d\d:\d\d/],
            ["HH:mm", /T\d\d:\d\d/],
            ["HH", /T\d\d/]
        ],
        K = /([\+\-]|\d\d)/gi,
        Q = "Month|Date|Hours|Minutes|Seconds|Milliseconds".split("|"),
        G = {
            Milliseconds: 1,
            Seconds: 1e3,
            Minutes: 6e4,
            Hours: 36e5,
            Days: 864e5,
            Months: 2592e6,
            Years: 31536e6
        }, Y = {}, Z = "DDD w M D d".split(" "),
        et = "M D H h m s w".split(" "),
        tt = {
            M: function () {
                return this.month() + 1
            },
            MMM: function (e) {
                return t("monthsShort", this.month(), this, e)
            },
            MMMM: function (e) {
                return t("months", this.month(), this, e)
            },
            D: function () {
                return this.date()
            },
            DDD: function () {
                var e = new Date(this.year(), this.month(), this.date()),
                    t = new Date(this.year(), 0, 1);
                return~~ ((e - t) / 864e5 + 1.5)
            },
            d: function () {
                return this.day()
            },
            dd: function (e) {
                return t("weekdaysMin", this.day(), this, e)
            },
            ddd: function (e) {
                return t("weekdaysShort", this.day(), this, e)
            },
            dddd: function (e) {
                return t("weekdays", this.day(), this, e)
            },
            w: function () {
                var e = new Date(this.year(), this.month(), this.date() - this.day() + 5),
                    t = new Date(e.getFullYear(), 0, 4);
                return~~ ((e - t) / 864e5 / 7 + 1.5)
            },
            YY: function () {
                return u(this.year() % 100, 2)
            },
            YYYY: function () {
                return u(this.year(), 4)
            },
            a: function () {
                return this.lang().meridiem(this.hours(), this.minutes(), !0)
            },
            A: function () {
                return this.lang().meridiem(this.hours(), this.minutes(), !1)
            },
            H: function () {
                return this.hours()
            },
            h: function () {
                return this.hours() % 12 || 12
            },
            m: function () {
                return this.minutes()
            },
            s: function () {
                return this.seconds()
            },
            S: function () {
                return~~ (this.milliseconds() / 100)
            },
            SS: function () {
                return u(~~(this.milliseconds() / 10), 2)
            },
            SSS: function () {
                return u(this.milliseconds(), 3)
            },
            Z: function () {
                var e = -this.zone(),
                    t = "+";
                return e < 0 && (e = -e, t = "-"), t + u(~~(e / 60), 2) + ":" + u(~~e % 60, 2)
            },
            ZZ: function () {
                var e = -this.zone(),
                    t = "+";
                return e < 0 && (e = -e, t = "-"), t + u(~~(10 * e / 6), 4)
            }
        };
    while (Z.length) O = Z.pop(), tt[O + "o"] = r(tt[O]);
    while (et.length) O = et.pop(), tt[O + O] = n(tt[O], 2);
    tt.DDDD = n(tt.DDD, 3), k = function (t, n) {
        if (t === null || t === "") return null;
        var r, s;
        return k.isMoment(t) ? new i(new Date(+t._d), t._isUTC, t._lang) : (n ? f(n) ? r = w(t, n) : r = b(t, n) : (s = H.exec(t), r = t === e ? new Date : s ? new Date(+s[1]) : t instanceof Date ? t : f(t) ? c(t) : typeof t == "string" ? E(t) : new Date(t)), new i(r))
    }, k.utc = function (e, t) {
        return f(e) ? new i(c(e, !0), !0) : (typeof e == "string" && !W.exec(e) && (e += " +0000", t && (t += " Z")), k(e, t).utc())
    }, k.unix = function (e) {
        return k(e * 1e3)
    }, k.duration = function (e, t) {
        var n = k.isDuration(e),
            r = typeof e == "number",
            i = n ? e._data : r ? {} : e,
            o;
        return r && (t ? i[t] = e : i.milliseconds = e), o = new s(i), n && (o._lang = e._lang), o
    }, k.humanizeDuration = function (e, t, n) {
        return k.duration(e, t === !0 ? null : t).humanize(t === !0 ? !0 : n)
    }, k.version = L, k.defaultFormat = $, k.lang = function (e, t) {
        var n;
        if (!e) return _;
        (t || !M[e]) && h(e, t);
        if (M[e]) {
            for (n = 0; n < P.length; n++) k[P[n]] = M[e][P[n]];
            k.monthsParse = M[e].monthsParse, _ = e
        }
    }, k.langData = p, k.isMoment = function (e) {
        return e instanceof i
    }, k.isDuration = function (e) {
        return e instanceof s
    }, k.lang("en", {
        months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"),
        monthsShort: "Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),
        weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),
        weekdaysShort: "Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),
        weekdaysMin: "Su_Mo_Tu_We_Th_Fr_Sa".split("_"),
        longDateFormat: {
            LT: "h:mm A",
            L: "MM/DD/YYYY",
            LL: "MMMM D YYYY",
            LLL: "MMMM D YYYY LT",
            LLLL: "dddd, MMMM D YYYY LT"
        },
        meridiem: function (e, t, n) {
            return e > 11 ? n ? "pm" : "PM" : n ? "am" : "AM"
        },
        calendar: {
            sameDay: "[Today at] LT",
            nextDay: "[Tomorrow at] LT",
            nextWeek: "dddd [at] LT",
            lastDay: "[Yesterday at] LT",
            lastWeek: "[last] dddd [at] LT",
            sameElse: "L"
        },
        relativeTime: {
            future: "in %s",
            past: "%s ago",
            s: "a few seconds",
            m: "a minute",
            mm: "%d minutes",
            h: "an hour",
            hh: "%d hours",
            d: "a day",
            dd: "%d days",
            M: "a month",
            MM: "%d months",
            y: "a year",
            yy: "%d years"
        },
        ordinal: function (e) {
            var t = e % 10;
            return~~ (e % 100 / 10) === 1 ? "th" : t === 1 ? "st" : t === 2 ? "nd" : t === 3 ? "rd" : "th"
        }
    }), k.fn = i.prototype = {
        clone: function () {
            return k(this)
        },
        valueOf: function () {
            return +this._d
        },
        unix: function () {
            return Math.floor(+this._d / 1e3)
        },
        toString: function () {
            return this._d.toString()
        },
        toDate: function () {
            return this._d
        },
        toArray: function () {
            var e = this;
            return [e.year(), e.month(), e.date(), e.hours(), e.minutes(), e.seconds(), e.milliseconds(), !! this._isUTC]
        },
        isValid: function () {
            return this._a ? this._a[8] != null ? !! this._a[8] : !l(this._a, (this._a[7] ? k.utc(this._a) : k(this._a)).toArray()) : !isNaN(this._d.getTime())
        },
        utc: function () {
            return this._isUTC = !0, this
        },
        local: function () {
            return this._isUTC = !1, this
        },
        format: function (e) {
            return m(this, e ? e : k.defaultFormat)
        },
        add: function (e, t) {
            var n = t ? k.duration(+t, e) : k.duration(e);
            return a(this, n, 1), this
        },
        subtract: function (e, t) {
            var n = t ? k.duration(+t, e) : k.duration(e);
            return a(this, n, -1), this
        },
        diff: function (e, t, n) {
            var r = this._isUTC ? k(e).utc() : k(e).local(),
                i = (this.zone() - r.zone()) * 6e4,
                s = this._d - r._d - i,
                o = this.year() - r.year(),
                u = this.month() - r.month(),
                a = this.date() - r.date(),
                f;
            return t === "months" ? f = o * 12 + u + a / 30 : t === "years" ? f = o + (u + a / 30) / 12 : f = t === "seconds" ? s / 1e3 : t === "minutes" ? s / 6e4 : t === "hours" ? s / 36e5 : t === "days" ? s / 864e5 : t === "weeks" ? s / 6048e5 : s, n ? f : A(f)
        },
        from: function (e, t) {
            return k.duration(this.diff(e)).lang(this._lang).humanize(!t)
        },
        fromNow: function (e) {
            return this.from(k(), e)
        },
        calendar: function () {
            var e = this.diff(k().sod(), "days", !0),
                t = this.lang().calendar,
                n = t.sameElse,
                r = e < -6 ? n : e < -1 ? t.lastWeek : e < 0 ? t.lastDay : e < 1 ? t.sameDay : e < 2 ? t.nextDay : e < 7 ? t.nextWeek : n;
            return this.format(typeof r == "function" ? r.apply(this) : r)
        },
        isLeapYear: function () {
            var e = this.year();
            return e % 4 === 0 && e % 100 !== 0 || e % 400 === 0
        },
        isDST: function () {
            return this.zone() < k([this.year()]).zone() || this.zone() < k([this.year(), 5]).zone()
        },
        day: function (e) {
            var t = this._isUTC ? this._d.getUTCDay() : this._d.getDay();
            return e == null ? t : this.add({
                d: e - t
            })
        },
        startOf: function (e) {
            switch (e.replace(/s$/, "")) {
            case "year":
                this.month(0);
            case "month":
                this.date(1);
            case "day":
                this.hours(0);
            case "hour":
                this.minutes(0);
            case "minute":
                this.seconds(0);
            case "second":
                this.milliseconds(0)
            }
            return this
        },
        endOf: function (e) {
            return this.startOf(e).add(e.replace(/s?$/, "s"), 1).subtract("ms", 1)
        },
        sod: function () {
            return this.clone().startOf("day")
        },
        eod: function () {
            return this.clone().endOf("day")
        },
        zone: function () {
            return this._isUTC ? 0 : this._d.getTimezoneOffset()
        },
        daysInMonth: function () {
            return k.utc([this.year(), this.month() + 1, 0]).date()
        },
        lang: function (t) {
            return t === e ? p(this) : (this._lang = t, this)
        }
    };
    for (O = 0; O < Q.length; O++) T(Q[O].toLowerCase(), Q[O]);
    T("year", "FullYear"), k.duration.fn = s.prototype = {
        weeks: function () {
            return o(this.days() / 7)
        },
        valueOf: function () {
            return this._milliseconds + this._days * 864e5 + this._months * 2592e6
        },
        humanize: function (e) {
            var t = +this,
                n = this.lang().relativeTime,
                r = x(t, !e, this.lang()),
                i = t <= 0 ? n.past : n.future;
            return e && (typeof i == "function" ? r = i(r) : r = i.replace(/%s/i, r)), r
        },
        lang: k.fn.lang
    };
    for (O in G) G.hasOwnProperty(O) && (C(O, G[O]), N(O.toLowerCase()));
    C("Weeks", 6048e5), D && (module.exports = k), typeof ender == "undefined" && (this.moment = k), typeof define == "function" && define.amd && define("moment", [], function () {
        return k
    })
}.call(this),
function (e) {
    var t = function (t, n) {
        this.$element = e(t);
        if (!this.$element.is("input")) {
            e.error("Combodate should be applied to INPUT element");
            return
        }
        this.options = e.extend({}, e.fn.combodate.defaults, n, this.$element.data()), this.init()
    };
    t.prototype = {
        constructor: t,
        init: function () {
            this.map = {
                day: ["D", "date"],
                month: ["M", "month"],
                year: ["Y", "year"],
                hour: ["[Hh]", "hours"],
                minute: ["m", "minutes"],
                second: ["s", "seconds"],
                ampm: ["[Aa]", ""]
            }, this.$widget = e('<span class="combodate"></span>').html(this.getTemplate()), this.initCombos(), this.$widget.on("change", "select", e.proxy(function () {
                this.$element.val(this.getValue())
            }, this)), this.$widget.find("select").css("width", "auto"), this.$element.hide().after(this.$widget), this.setValue(this.$element.val() || this.options.value)
        },
        getTemplate: function () {
            var t = this.options.template;
            return e.each(this.map, function (e, n) {
                n = n[0];
                var r = new RegExp(n + "+"),
                    i = n.length > 1 ? n.substring(1, 2) : n;
                t = t.replace(r, "{" + i + "}")
            }), t = t.replace(/ /g, "&nbsp;"), e.each(this.map, function (e, n) {
                n = n[0];
                var r = n.length > 1 ? n.substring(1, 2) : n;
                t = t.replace("{" + r + "}", '<select class="' + e + '"></select>')
            }), t
        },
        initCombos: function () {
            var t = this;
            e.each(this.map, function (e, n) {
                var r = t.$widget.find("." + e),
                    i, s;
                r.length && (t["$" + e] = r, i = "fill" + e.charAt(0).toUpperCase() + e.slice(1), s = t[i](), t["$" + e].html(t.renderItems(s)))
            })
        },
        initItems: function (e) {
            var t = [];
            if (this.options.firstItem === "name") {
                var n = typeof moment.relativeTime[e] == "function" ? moment.relativeTime[e](1, !0, e, !1) : moment.relativeTime[e];
                n = n.split(" ").reverse()[0], t.push(["", n])
            } else this.options.firstItem === "empty" && t.push(["", ""]);
            return t
        },
        renderItems: function (e) {
            var t = [];
            for (var n = 0; n < e.length; n++) t.push('<option value="' + e[n][0] + '">' + e[n][1] + "</option>");
            return t.join("\n")
        },
        fillDay: function () {
            var e = this.initItems("d"),
                t, n, r = this.options.template.indexOf("DD") !== -1;
            for (n = 1; n <= 31; n++) t = r ? this.leadZero(n) : n, e.push([n, t]);
            return e
        },
        fillMonth: function () {
            var e = this.initItems("M"),
                t, n, r = this.options.template.indexOf("MMMM") !== -1,
                i = this.options.template.indexOf("MMM") !== -1,
                s = this.options.template.indexOf("MM") !== -1;
            for (n = 0; n <= 11; n++) r ? t = moment.months[n] : i ? t = moment.monthsShort[n] : s ? t = this.leadZero(n + 1) : t = n + 1, e.push([n, t]);
            return e
        },
        fillYear: function () {
            var e = this.initItems("y"),
                t, n, r = this.options.template.indexOf("YYYY") !== -1;
            for (n = this.options.maxYear; n >= this.options.minYear; n--) t = r ? n : (n + "").substring(2), e.push([n, t]);
            return e
        },
        fillHour: function () {
            var e = this.initItems("h"),
                t, n, r = this.options.template.indexOf("h") !== -1,
                i = this.options.template.indexOf("H") !== -1,
                s = this.options.template.toLowerCase().indexOf("hh") !== -1,
                o = r ? 12 : 23;
            for (n = 0; n <= o; n++) t = s ? this.leadZero(n) : n, e.push([n, t]);
            return e
        },
        fillMinute: function () {
            var e = this.initItems("m"),
                t, n, r = this.options.template.indexOf("mm") !== -1;
            for (n = 0; n <= 59; n += this.options.minuteStep) t = r ? this.leadZero(n) : n, e.push([n, t]);
            return e
        },
        fillSecond: function () {
            var e = this.initItems("s"),
                t, n, r = this.options.template.indexOf("ss") !== -1;
            for (n = 0; n <= 59; n += this.options.secondStep) t = r ? this.leadZero(n) : n, e.push([n, t]);
            return e
        },
        fillAmpm: function () {
            var e = this.options.template.indexOf("a") !== -1,
                t = this.options.template.indexOf("A") !== -1,
                n = [
                    ["am", e ? "am" : "AM"],
                    ["pm", e ? "pm" : "PM"]
                ];
            return n
        },
        getValue: function (t) {
            var n, r = {}, i = this,
                s = !1;
            return e.each(this.map, function (e, t) {
                if (e === "ampm") return;
                var n = e === "day" ? 1 : 0;
                r[e] = i["$" + e] ? parseInt(i["$" + e].val(), 10) : n;
                if (isNaN(r[e])) return s = !0, !1
            }), s ? "" : (this.$ampm && (r.hour = this.$ampm.val() === "am" ? r.hour : r.hour + 12, r.hour === 24 && (r.hour = 0)), n = moment([r.year, r.month, r.day, r.hour, r.minute, r.second]), this.highlight(n), t = t === undefined ? this.options.format : t, t === null ? n.isValid() ? n : null : n.isValid() ? n.format(t) : "")
        },
        setValue: function (t) {
            if (!t) return;
            var n = typeof t == "string" ? moment(t, this.options.format) : moment(t),
                r = this,
                i = {};
            n.isValid() && (e.each(this.map, function (e, t) {
                if (e === "ampm") return;
                i[e] = n[t[1]]()
            }), this.$ampm && (i.hour > 12 ? (i.hour -= 12, i.ampm = "pm") : i.ampm = "am"), e.each(i, function (e, t) {
                r["$" + e] && r["$" + e].val(t)
            }), this.$element.val(n.format(this.options.format)))
        },
        highlight: function (e) {
            e.isValid() ? this.options.errorClass ? this.$widget.removeClass(this.options.errorClass) : this.$widget.find("select").css("border-color", this.borderColor) : this.options.errorClass ? this.$widget.addClass(this.options.errorClass) : (this.borderColor || (this.borderColor = this.$widget.find("select").css("border-color")), this.$widget.find("select").css("border-color", "red"))
        },
        leadZero: function (e) {
            return e <= 9 ? "0" + e : e
        },
        destroy: function () {
            this.$widget.remove(), this.$element.removeData("combodate").show()
        }
    }, e.fn.combodate = function (n) {
        var r, i = Array.apply(null, arguments);
        return i.shift(), n === "getValue" && this.length && (r = this.eq(0).data("combodate")) ? r.getValue.apply(r, i) : this.each(function () {
            var r = e(this),
                s = r.data("combodate"),
                o = typeof n == "object" && n;
            s || r.data("combodate", s = new t(this, o)), typeof n == "string" && typeof s[n] == "function" && s[n].apply(s, i)
        })
    }, e.fn.combodate.defaults = {
        format: "DD-MM-YYYY HH:mm",
        template: "D / MMM / YYYY   H : mm",
        value: null,
        minYear: 1970,
        maxYear: 2015,
        minuteStep: 5,
        secondStep: 1,
        firstItem: "empty",
        errorClass: null
    }
}(window.jQuery),
function (e) {
    var t = function (t, n) {
        this.options = e.extend({}, e.fn.editableform.defaults, n), this.$div = e(t), this.options.scope || (this.options.scope = this)
    };
    t.prototype = {
        constructor: t,
        initInput: function () {
            this.input = this.options.input, this.value = this.input.str2value(this.options.value)
        },
        initTemplate: function () {
            this.$form = e(e.fn.editableform.template)
        },
        initButtons: function () {
            this.$form.find(".editable-buttons").append(e.fn.editableform.buttons)
        },
        render: function () {
            this.$loading = e(e.fn.editableform.loading), this.$div.empty().append(this.$loading), this.initTemplate(), this.options.showbuttons ? this.initButtons() : this.$form.find(".editable-buttons").remove(), this.showLoading(), this.$div.triggerHandler("rendering"), this.initInput(), this.input.prerender(), this.$form.find("div.editable-input").append(this.input.$tpl), this.$div.append(this.$form), e.when(this.input.render()).then(e.proxy(function () {
                this.options.showbuttons || this.input.autosubmit(), this.$form.find(".editable-cancel").click(e.proxy(this.cancel, this)), this.input.error ? (this.error(this.input.error), this.$form.find(".editable-submit").attr("disabled", !0), this.input.$input.attr("disabled", !0), this.$form.submit(function (e) {
                    e.preventDefault()
                })) : (this.error(!1), this.input.$input.removeAttr("disabled"), this.$form.find(".editable-submit").removeAttr("disabled"), this.input.value2input(this.value), this.$form.submit(e.proxy(this.submit, this))), this.$div.triggerHandler("rendered"), this.showForm(), this.input.postrender && this.input.postrender()
            }, this))
        },
        cancel: function () {
            this.$div.triggerHandler("cancel")
        },
        showLoading: function () {
            var e, t;
            this.$form ? (e = this.$form.outerWidth(), t = this.$form.outerHeight(), e && this.$loading.width(e), t && this.$loading.height(t), this.$form.hide()) : (e = this.$loading.parent().width(), e && this.$loading.width(e)), this.$loading.show()
        },
        showForm: function (e) {
            this.$loading.hide(), this.$form.show(), e !== !1 && this.input.activate(), this.$div.triggerHandler("show")
        },
        error: function (t) {
            var n = this.$form.find(".control-group"),
                r = this.$form.find(".editable-error-block"),
                i;
            if (t === !1) n.removeClass(e.fn.editableform.errorGroupClass), r.removeClass(e.fn.editableform.errorBlockClass).empty().hide();
            else {
                if (t) {
                    i = t.split("\n");
                    for (var s = 0; s < i.length; s++) i[s] = e("<div>").text(i[s]).html();
                    t = i.join("<br>")
                }
                n.addClass(e.fn.editableform.errorGroupClass), r.addClass(e.fn.editableform.errorBlockClass).html(t).show()
            }
        },
        submit: function (t) {
            t.stopPropagation(), t.preventDefault();
            var n, r = this.input.input2value();
            if (n = this.validate(r)) {
                this.error(n), this.showForm();
                return
            }
            if (!this.options.savenochange && this.input.value2str(r) == this.input.value2str(this.value)) {
                this.$div.triggerHandler("nochange");
                return
            }
            e.when(this.save(r)).done(e.proxy(function (e) {
                var t = typeof this.options.success == "function" ? this.options.success.call(this.options.scope, e, r) : null;
                if (t === !1) {
                    this.error(!1), this.showForm(!1);
                    return
                }
                if (typeof t == "string") {
                    this.error(t), this.showForm();
                    return
                }
                t && typeof t == "object" &&
                    t.hasOwnProperty("newValue") && (r = t.newValue), this.error(!1), this.value = r, this.$div.triggerHandler("save", {
                        newValue: r,
                        response: e
                    })
            }, this)).fail(e.proxy(function (e) {
                this.error(typeof e == "string" ? e : e.responseText || e.statusText || "Unknown error!"), this.showForm()
            }, this))
        },
        save: function (t) {
            var n = this.input.value2submit(t);
            this.options.pk = e.fn.editableutils.tryParseJson(this.options.pk, !0);
            var r = typeof this.options.pk == "function" ? this.options.pk.call(this.options.scope) : this.options.pk,
                i = !! (typeof this.options.url == "function" || this.options.url && (this.options.send === "always" || this.options.send === "auto" && r)),
                s;
            if (i) return this.showLoading(), s = {
                name: this.options.name || "",
                value: n,
                pk: r
            }, typeof this.options.params == "function" ? s = this.options.params.call(this.options.scope, s) : (this.options.params = e.fn.editableutils.tryParseJson(this.options.params, !0), e.extend(s, this.options.params)), typeof this.options.url == "function" ? this.options.url.call(this.options.scope, s) : e.ajax(e.extend({
                url: this.options.url,
                data: s,
                type: "POST"
            }, this.options.ajaxOptions))
        },
        validate: function (e) {
            e === undefined && (e = this.value);
            if (typeof this.options.validate == "function") return this.options.validate.call(this.options.scope, e)
        },
        option: function (e, t) {
            e in this.options && (this.options[e] = t), e === "value" && this.setValue(t)
        },
        setValue: function (e, t) {
            t ? this.value = this.input.str2value(e) : this.value = e, this.$form && this.$form.is(":visible") && this.input.value2input(this.value)
        }
    }, e.fn.editableform = function (n) {
        var r = arguments;
        return this.each(function () {
            var i = e(this),
                s = i.data("editableform"),
                o = typeof n == "object" && n;
            s || i.data("editableform", s = new t(this, o)), typeof n == "string" && s[n].apply(s, Array.prototype.slice.call(r, 1))
        })
    }, e.fn.editableform.Constructor = t, e.fn.editableform.defaults = {
        type: "text",
        url: null,
        params: null,
        name: null,
        pk: null,
        value: null,
        send: "auto",
        validate: null,
        success: null,
        ajaxOptions: null,
        showbuttons: !0,
        scope: null,
        savenochange: !1
    }, e.fn.editableform.template = '<form class="form-inline editableform"><div class="control-group"><div><div class="editable-input"></div><div class="editable-buttons"></div></div><div class="editable-error-block"></div></div></form>', e.fn.editableform.loading = '<div class="editableform-loading"></div>', e.fn.editableform.buttons = '<button type="submit" class="editable-submit">ok</button><button type="button" class="editable-cancel">cancel</button>', e.fn.editableform.errorGroupClass = null, e.fn.editableform.errorBlockClass = "editable-error"
}(window.jQuery),
function (e) {
    e.fn.editableutils = {
        inherit: function (e, t) {
            var n = function () {};
            n.prototype = t.prototype, e.prototype = new n, e.prototype.constructor = e, e.superclass = t.prototype
        },
        setCursorPosition: function (e, t) {
            if (e.setSelectionRange) e.setSelectionRange(t, t);
            else if (e.createTextRange) {
                var n = e.createTextRange();
                n.collapse(!0), n.moveEnd("character", t), n.moveStart("character", t), n.select()
            }
        },
        tryParseJson: function (e, t) {
            if (typeof e == "string" && e.length && e.match(/^[\{\[].*[\}\]]$/))
                if (t) try {
                    e = (new Function("return " + e))()
                } catch (n) {} finally {
                    return e
                } else e = (new Function("return " + e))();
            return e
        },
        sliceObj: function (t, n, r) {
            var i, s, o = {};
            if (!e.isArray(n) || !n.length) return o;
            for (var u = 0; u < n.length; u++) {
                i = n[u], t.hasOwnProperty(i) && (o[i] = t[i]);
                if (r === !0) continue;
                s = i.toLowerCase(), t.hasOwnProperty(s) && (o[i] = t[s])
            }
            return o
        },
        getConfigData: function (t) {
            var n = {};
            return e.each(t.data(), function (e, t) {
                if (typeof t != "object" || t && typeof t == "object" && (t.constructor === Object || t.constructor === Array)) n[e] = t
            }), n
        },
        objectKeys: function (e) {
            if (Object.keys) return Object.keys(e);
            if (e !== Object(e)) throw new TypeError("Object.keys called on a non-object");
            var t = [],
                n;
            for (n in e) Object.prototype.hasOwnProperty.call(e, n) && t.push(n);
            return t
        },
        escape: function (t) {
            return e("<div>").text(t).html()
        },
        itemsByValue: function (t, n, r) {
            if (!n || t === null) return [];
            r = r || "value";
            var i = e.isArray(t),
                s = [],
                o = this;
            return e.each(n, function (n, u) {
                u.children ? s = s.concat(o.itemsByValue(t, u.children)) : i ? e.grep(t, function (e) {
                    return e == (u && typeof u === "object" ? u[r] : u)
                }).length && s.push(u) : t == (u && typeof u === "object" ? u[r] : u) && s.push(u)
            }), s
        },
        createInput: function (t) {
            var n, r, i, s = t.type;
            return s === "date" && (t.mode === "inline" ? e.fn.editabletypes.datefield ? s = "datefield" : e.fn.editabletypes.dateuifield && (s = "dateuifield") : e.fn.editabletypes.date ? s = "date" : e.fn.editabletypes.dateui && (s = "dateui"), s === "date" && !e.fn.editabletypes.date && (s = "combodate")), s === "wysihtml5" && !e.fn.editabletypes[s] && (s = "textarea"), typeof e.fn.editabletypes[s] == "function" ? (n = e.fn.editabletypes[s], r = this.sliceObj(t, this.objectKeys(n.defaults)), i = new n(r), i) : (e.error("Unknown type: " + s), !1)
        }
    }
}(window.jQuery),
function (e) {
    var t = function (e, t) {
        this.init(e, t)
    }, n = function (e, t) {
            this.init(e, t)
        };
    t.prototype = {
        containerName: null,
        innerCss: null,
        init: function (n, r) {
            this.$element = e(n), this.options = e.extend({}, e.fn.editableContainer.defaults, r), this.splitOptions(), this.formOptions.scope = this.$element[0], this.initContainer(), this.$element.on("destroyed", e.proxy(function () {
                this.destroy()
            }, this)), e(document).data("editable-handlers-attached") || (e(document).on("keyup.editable", function (t) {
                t.which === 27 && e(".editable-open").editableContainer("hide")
            }), e(document).on("click.editable", function (n) {
                var r = e(n.target),
                    i, s = [".editable-container", ".ui-datepicker-header", ".modal-backdrop", ".bootstrap-wysihtml5-insert-image-modal", ".bootstrap-wysihtml5-insert-link-modal"];
                for (i = 0; i < s.length; i++)
                    if (r.is(s[i]) || r.parents(s[i]).length) return;
                t.prototype.closeOthers(n.target)
            }), e(document).data("editable-handlers-attached", !0))
        },
        splitOptions: function () {
            this.containerOptions = {}, this.formOptions = {};
            var t = e.fn[this.containerName].defaults;
            for (var n in this.options) n in t ? this.containerOptions[n] = this.options[n] : this.formOptions[n] = this.options[n]
        },
        tip: function () {
            return this.container() ? this.container().$tip : null
        },
        container: function () {
            return this.$element.data(this.containerName)
        },
        call: function () {
            this.$element[this.containerName].apply(this.$element, arguments)
        },
        initContainer: function () {
            this.call(this.containerOptions)
        },
        renderForm: function () {
            this.$form.editableform(this.formOptions).on({
                save: e.proxy(this.save, this),
                nochange: e.proxy(function () {
                    this.hide("nochange")
                }, this),
                cancel: e.proxy(function () {
                    this.hide("cancel")
                }, this),
                show: e.proxy(this.setPosition, this),
                rendering: e.proxy(this.setPosition, this),
                resize: e.proxy(this.setPosition, this),
                rendered: e.proxy(function () {
                    this.$element.triggerHandler("shown")
                }, this)
            }).editableform("render")
        },
        show: function (t) {
            this.$element.addClass("editable-open"), t !== !1 && this.closeOthers(this.$element[0]), this.innerShow(), this.tip().addClass("editable-container"), this.$form, this.$form = e("<div>"), this.tip().is(this.innerCss) ? this.tip().append(this.$form) : this.tip().find(this.innerCss).append(this.$form), this.renderForm()
        },
        hide: function (e) {
            if (!this.tip() || !this.tip().is(":visible") || !this.$element.hasClass("editable-open")) return;
            this.$element.removeClass("editable-open"), this.innerHide(), this.$element.triggerHandler("hidden", e)
        },
        innerShow: function () {},
        innerHide: function () {},
        toggle: function (e) {
            this.container() && this.tip() && this.tip().is(":visible") ? this.hide() : this.show(e)
        },
        setPosition: function () {},
        save: function (e, t) {
            this.$element.triggerHandler("save", t), this.hide("save")
        },
        option: function (e, t) {
            this.options[e] = t, e in this.containerOptions ? (this.containerOptions[e] = t, this.setContainerOption(e, t)) : (this.formOptions[e] = t, this.$form && this.$form.editableform("option", e, t))
        },
        setContainerOption: function (e, t) {
            this.call("option", e, t)
        },
        destroy: function () {
            this.hide(), this.innerDestroy(), this.$element.off("destroyed"), this.$element.removeData("editableContainer")
        },
        innerDestroy: function () {},
        closeOthers: function (t) {
            e(".editable-open").each(function (n, r) {
                if (r === t || e(r).find(t).length) return;
                var i = e(r),
                    s = i.data("editableContainer");
                if (!s) return;
                s.options.onblur === "cancel" ? i.data("editableContainer").hide("onblur") : s.options.onblur === "submit" && i.data("editableContainer").tip().find("form").submit()
            })
        },
        activate: function () {
            this.tip && this.tip().is(":visible") && this.$form && this.$form.data("editableform").input.activate()
        }
    }, e.fn.editableContainer = function (r) {
        var i = arguments;
        return this.each(function () {
            var s = e(this),
                o = "editableContainer",
                u = s.data(o),
                a = typeof r == "object" && r,
                f = a.mode === "inline" ? n : t;
            u || s.data(o, u = new f(this, a)), typeof r == "string" && u[r].apply(u, Array.prototype.slice.call(i, 1))
        })
    }, e.fn.editableContainer.Popup = t, e.fn.editableContainer.Inline = n, e.fn.editableContainer.defaults = {
        value: null,
        placement: "top",
        autohide: !0,
        onblur: "cancel",
        anim: "fast",
        mode: "popup"
    }, jQuery.event.special.destroyed = {
        remove: function (e) {
            e.handler && e.handler()
        }
    }
}(window.jQuery),
function (e) {
    e.extend(e.fn.editableContainer.Inline.prototype, e.fn.editableContainer.Popup.prototype, {
        containerName: "editableform",
        innerCss: ".editable-inline",
        initContainer: function () {
            this.$tip = e("<span></span>").addClass("editable-inline"), this.options.anim || (this.options.anim = 0)
        },
        splitOptions: function () {
            this.containerOptions = {}, this.formOptions = this.options
        },
        tip: function () {
            return this.$tip
        },
        innerShow: function () {
            this.$element.hide(), this.tip().insertAfter(this.$element).show()
        },
        innerHide: function () {
            this.$tip.hide(this.options.anim, e.proxy(function () {
                this.$element.show(), this.innerDestroy()
            }, this))
        },
        innerDestroy: function () {
            this.tip() && this.tip().empty().remove()
        }
    })
}(window.jQuery),
function (e) {
    var t = function (t, n) {
        this.$element = e(t), this.options = e.extend({}, e.fn.editable.defaults, n, e.fn.editableutils.getConfigData(this.$element)), this.options.selector ? this.initLive() : this.init()
    };
    t.prototype = {
        constructor: t,
        init: function () {
            var t = !1,
                n, r;
            this.options.name = this.options.name || this.$element.attr("id"), this.input = e.fn.editableutils.createInput(this.options);
            if (!this.input) return;
            this.options.value === undefined || this.options.value === null ? (this.value = this.input.html2value(e.trim(this.$element.html())), t = !0) : (this.options.value = e.fn.editableutils.tryParseJson(this.options.value, !0), typeof this.options.value == "string" ? this.value = this.input.str2value(this.options.value) : this.value = this.options.value), this.$element.addClass("editable"), this.options.toggle !== "manual" ? (this.$element.addClass("editable-click"), this.$element.on(this.options.toggle + ".editable", e.proxy(function (e) {
                e.preventDefault();
                if (this.options.toggle === "mouseenter") this.show();
                else {
                    var t = this.options.toggle !== "click";
                    this.toggle(t)
                }
            }, this))) : this.$element.attr("tabindex", -1), n = !t && this.value !== null && this.value !== undefined, n &= this.options.autotext === "always" || this.options.autotext === "auto" && !this.$element.text().length, e.when(n ? this.render() : !0).then(e.proxy(function () {
                this.options.disabled ? this.disable() : this.enable(), this.$element.triggerHandler("init", this)
            }, this))
        },
        initLive: function () {
            var t = this.options.selector;
            this.options.selector = !1, this.options.autotext = "never", this.$element.on(this.options.toggle + ".editable", t, e.proxy(function (t) {
                var n = e(t.target);
                n.data("editable") || n.editable(this.options).trigger(t)
            }, this))
        },
        render: function (e) {
            if (this.options.display === !1) return;
            return this.input.value2htmlFinal ? this.input.value2html(this.value, this.$element[0], this.options.display, e) : typeof this.options.display == "function" ? this.options.display.call(this.$element[0], this.value, e) : this.input.value2html(this.value, this.$element[0])
        },
        enable: function () {
            this.options.disabled = !1, this.$element.removeClass("editable-disabled"), this.handleEmpty(this.isEmpty), this.options.toggle !== "manual" && this.$element.attr("tabindex") === "-1" && this.$element.removeAttr("tabindex")
        },
        disable: function () {
            this.options.disabled = !0, this.hide(), this.$element.addClass("editable-disabled"), this.handleEmpty(this.isEmpty), this.$element.attr("tabindex", -1)
        },
        toggleDisabled: function () {
            this.options.disabled ? this.enable() : this.disable()
        },
        option: function (t, n) {
            if (t && typeof t == "object") {
                e.each(t, e.proxy(function (t, n) {
                    this.option(e.trim(t), n)
                }, this));
                return
            }
            this.options[t] = n;
            if (t === "disabled") return n ? this.disable() : this.enable();
            t === "value" && this.setValue(n), this.container && this.container.option(t, n), this.input.option && this.input.option(t, n)
        },
        handleEmpty: function (t) {
            if (this.options.display === !1) return;
            this.isEmpty = t !== undefined ? t : e.trim(this.$element.text()) === "", this.options.disabled ? this.isEmpty && (this.$element.empty(), this.options.emptyclass && this.$element.removeClass(this.options.emptyclass)) : this.isEmpty ? (this.$element.text(this.options.emptytext), this.options.emptyclass && this.$element.addClass(this.options.emptyclass)) : this.options.emptyclass && this.$element.removeClass(this.options.emptyclass)
        },
        show: function (t) {
            if (this.options.disabled) return;
            if (!this.container) {
                var n = e.extend({}, this.options, {
                    value: this.value,
                    input: this.input
                });
                this.$element.editableContainer(n), this.$element.on("save.internal", e.proxy(this.save, this)), this.container = this.$element.data("editableContainer")
            } else if (this.container.tip().is(":visible")) return;
            this.container.show(t)
        },
        hide: function () {
            this.container && this.container.hide()
        },
        toggle: function (e) {
            this.container && this.container.tip().is(":visible") ? this.hide() : this.show(e)
        },
        save: function (e, t) {
            if (this.options.unsavedclass) {
                var n = !1;
                n = n || typeof this.options.url == "function", n = n || this.options.display === !1, n = n || t.response !== undefined, n = n || this.options.savenochange && this.input.value2str(this.value) !== this.input.value2str(t.newValue), n ? this.$element.removeClass(this.options.unsavedclass) : this.$element.addClass(this.options.unsavedclass)
            }
            this.setValue(t.newValue, !1, t.response)
        },
        validate: function () {
            if (typeof this.options.validate == "function") return this.options.validate.call(this, this.value)
        },
        setValue: function (t, n, r) {
            n ? this.value = this.input.str2value(t) : this.value = t, this.container && this.container.option("value", this.value), e.when(this.render(r)).then(e.proxy(function () {
                this.handleEmpty()
            }, this))
        },
        activate: function () {
            this.container && this.container.activate()
        },
        destroy: function () {
            this.container && this.container.destroy(), this.options.toggle !== "manual" && (this.$element.removeClass("editable-click"), this.$element.off(this.options.toggle + ".editable")), this.$element.off("save.internal"), this.$element.removeClass("editable"), this.$element.removeClass("editable-open"), this.$element.removeData("editable")
        }
    }, e.fn.editable = function (n) {
        var r = {}, i = arguments,
            s = "editable";
        switch (n) {
        case "validate":
            return this.each(function () {
                var t = e(this),
                    n = t.data(s),
                    i;
                n && (i = n.validate()) && (r[n.options.name] = i)
            }), r;
        case "getValue":
            return this.each(function () {
                var t = e(this),
                    n = t.data(s);
                n && n.value !== undefined && n.value !== null && (r[n.options.name] = n.input.value2submit(n.value))
            }), r;
        case "submit":
            var o = arguments[1] || {}, u = this,
                a = this.editable("validate"),
                f;
            return e.isEmptyObject(a) ? (f = this.editable("getValue"), o.data && e.extend(f, o.data), e.ajax(e.extend({
                url: o.url,
                data: f,
                type: "POST"
            }, o.ajaxOptions)).success(function (e) {
                typeof o.success == "function" && o.success.call(u, e, o)
            }).error(function () {
                typeof o.error == "function" && o.error.apply(u, arguments)
            })) : typeof o.error == "function" && o.error.call(u, a), this
        }
        return this.each(function () {
            var r = e(this),
                o = r.data(s),
                u = typeof n == "object" && n;
            o || r.data(s, o = new t(this, u)), typeof n == "string" && o[n].apply(o, Array.prototype.slice.call(i, 1))
        })
    }, e.fn.editable.defaults = {
        type: "text",
        disabled: !1,
        toggle: "click",
        emptytext: "Empty",
        autotext: "auto",
        value: null,
        display: null,
        emptyclass: "editable-empty",
        unsavedclass: "editable-unsaved",
        selector: null
    }
}(window.jQuery),
function (e) {
    e.fn.editabletypes = {};
    var t = function () {};
    t.prototype = {
        init: function (t, n, r) {
            this.type = t, this.options = e.extend({}, r, n)
        },
        prerender: function () {
            this.$tpl = e(this.options.tpl), this.$input = this.$tpl, this.$clear = null, this.error = null
        },
        render: function () {},
        value2html: function (t, n) {
            e(n).text(t)
        },
        html2value: function (t) {
            return e("<div>").html(t).text()
        },
        value2str: function (e) {
            return e
        },
        str2value: function (e) {
            return e
        },
        value2submit: function (e) {
            return e
        },
        value2input: function (e) {
            this.$input.val(e)
        },
        input2value: function () {
            return this.$input.val()
        },
        activate: function () {
            this.$input.is(":visible") && this.$input.focus()
        },
        clear: function () {
            this.$input.val(null)
        },
        escape: function (t) {
            return e("<div>").text(t).html()
        },
        autosubmit: function () {},
        setClass: function () {
            this.options.inputclass && this.$input.addClass(this.options.inputclass)
        },
        setAttr: function (e) {
            this.options[e] && this.$input.attr(e, this.options[e])
        },
        option: function (e, t) {
            this.options[e] = t
        }
    }, t.defaults = {
        tpl: "",
        inputclass: "input-medium"
    }, e.extend(e.fn.editabletypes, {
        abstractinput: t
    })
}(window.jQuery),
function (e) {
    var t = function (e) {};
    e.fn.editableutils.inherit(t, e.fn.editabletypes.abstractinput), e.extend(t.prototype, {
        render: function () {
            var t = e.Deferred();
            return this.error = null, this.onSourceReady(function () {
                this.renderList(), t.resolve()
            }, function () {
                this.error = this.options.sourceError, t.resolve()
            }), t.promise()
        },
        html2value: function (e) {
            return null
        },
        value2html: function (t, n, r, i) {
            var s = e.Deferred(),
                o = function () {
                    typeof r == "function" ? r.call(n, t, this.sourceData, i) : this.value2htmlFinal(t, n), s.resolve()
                };
            return t === null ? o.call(this) : this.onSourceReady(o, function () {
                s.resolve()
            }), s.promise()
        },
        onSourceReady: function (t, n) {
            if (e.isArray(this.sourceData)) {
                t.call(this);
                return
            }
            try {
                this.options.source = e.fn.editableutils.tryParseJson(this.options.source, !1)
            } catch (r) {
                n.call(this);
                return
            }
            if (typeof this.options.source == "string") {
                if (this.options.sourceCache) {
                    var i = this.options.source,
                        s;
                    e(document).data(i) || e(document).data(i, {}), s = e(document).data(i);
                    if (s.loading === !1 && s.sourceData) {
                        this.sourceData = s.sourceData, this.doPrepend(), t.call(this);
                        return
                    }
                    if (s.loading === !0) {
                        s.callbacks.push(e.proxy(function () {
                            this.sourceData = s.sourceData, this.doPrepend(), t.call(this)
                        }, this)), s.err_callbacks.push(e.proxy(n, this));
                        return
                    }
                    s.loading = !0, s.callbacks = [], s.err_callbacks = []
                }
                e.ajax({
                    url: this.options.source,
                    type: "get",
                    cache: !1,
                    dataType: "json",
                    success: e.proxy(function (r) {
                        s && (s.loading = !1), this.sourceData = this.makeArray(r), e.isArray(this.sourceData) ? (s && (s.sourceData = this.sourceData, e.each(s.callbacks, function () {
                            this.call()
                        })), this.doPrepend(), t.call(this)) : (n.call(this), s && e.each(s.err_callbacks, function () {
                            this.call()
                        }))
                    }, this),
                    error: e.proxy(function () {
                        n.call(this), s && (s.loading = !1, e.each(s.err_callbacks, function () {
                            this.call()
                        }))
                    }, this)
                })
            } else e.isFunction(this.options.source) ? this.sourceData = this.makeArray(this.options.source()) : this.sourceData = this.makeArray(this.options.source), e.isArray(this.sourceData) ? (this.doPrepend(), t.call(this)) : n.call(this)
        },
        doPrepend: function () {
            if (this.options.prepend === null || this.options.prepend === undefined) return;
            e.isArray(this.prependData) || (this.options.prepend = e.fn.editableutils.tryParseJson(this.options.prepend, !0), typeof this.options.prepend == "string" && (this.options.prepend = {
                "": this.options.prepend
            }), typeof this.options.prepend == "function" ? this.prependData = this.makeArray(this.options.prepend()) : this.prependData = this.makeArray(this.options.prepend)), e.isArray(this.prependData) && e.isArray(this.sourceData) && (this.sourceData = this.prependData.concat(this.sourceData))
        },
        renderList: function () {},
        value2htmlFinal: function (e, t) {},
        makeArray: function (t) {
            var n, r, i = [],
                s, o;
            if (!t || typeof t == "string") return null;
            if (e.isArray(t)) {
                o = function (e, t) {
                    r = {
                        value: e,
                        text: t
                    };
                    if (n++ >= 2) return !1
                };
                for (var u = 0; u < t.length; u++) s = t[u], typeof s == "object" ? (n = 0, e.each(s, o), n === 1 ? i.push(r) : n > 1 && (s.children && (s.children = this.makeArray(s.children)), i.push(s))) : i.push({
                    value: s,
                    text: s
                })
            } else e.each(t, function (e, t) {
                i.push({
                    value: e,
                    text: t
                })
            });
            return i
        },
        option: function (e, t) {
            this.options[e] = t, e === "source" && (this.sourceData = null), e === "prepend" && (this.prependData = null)
        }
    }), t.defaults = e.extend({}, e.fn.editabletypes.abstractinput.defaults, {
        source: null,
        prepend: !1,
        sourceError: "Error when loading list",
        sourceCache: !0
    }), e.fn.editabletypes.list = t
}(window.jQuery),
function (e) {
    var t = function (e) {
        this.init("text", e, t.defaults)
    };
    e.fn.editableutils.inherit(t, e.fn.editabletypes.abstractinput), e.extend(t.prototype, {
        render: function () {
            this.renderClear(), this.setClass(), this.setAttr("placeholder")
        },
        activate: function () {
            this.$input.is(":visible") && (this.$input.focus(), e.fn.editableutils.setCursorPosition(this.$input.get(0), this.$input.val().length), this.toggleClear && this.toggleClear())
        },
        renderClear: function () {
            this.options.clear && (this.$clear = e('<span class="editable-clear-x icon-remove-sign"></span>'), this.$input.after(this.$clear).css("padding-right", 20).keyup(e.proxy(this.toggleClear, this)).parent().css("position", "relative"), this.$clear.click(e.proxy(this.clear, this)))
        },
        postrender: function () {
            if (this.$clear) {
                var e = this.$input.outerHeight() || 20,
                    t = (e - this.$clear.height()) / 2;
                t < 3 && (t = 3), this.$clear.css({
                    top: t,
                    right: t
                })
            }
        },
        toggleClear: function () {
            if (!this.$clear) return;
            this.$input.val().length ? this.$clear.show() : this.$clear.hide()
        },
        clear: function () {
            this.$clear.hide(), this.$input.val("").focus()
        }
    }), t.defaults = e.extend({}, e.fn.editabletypes.abstractinput.defaults, {
        tpl: '<input type="text">',
        placeholder: null,
        clear: !0
    }), e.fn.editabletypes.text = t
}(window.jQuery),
function (e) {
    var t = function (e) {
        this.init("textarea", e, t.defaults)
    };
    e.fn.editableutils.inherit(t, e.fn.editabletypes.abstractinput), e.extend(t.prototype, {
        render: function () {
            this.setClass(), this.setAttr("placeholder"), this.setAttr("rows"), this.$input.keydown(function (t) {
                t.ctrlKey && t.which === 13 && e(this).closest("form").submit()
            })
        },
        value2html: function (t, n) {
            var r = "",
                i;
            if (t) {
                i = t.split("\n");
                for (var s = 0; s < i.length; s++) i[s] = e("<div>").text(i[s]).html();
                r = i.join("<br>")
            }
            e(n).html(r)
        },
        html2value: function (t) {
            if (!t) return "";
            var n = new RegExp(String.fromCharCode(10), "g"),
                r = t.split(/<br\s*\/?>/i);
            for (var i = 0; i < r.length; i++) {
                var s = e("<div>").html(r[i]).text();
                s = s.replace(n, ""), r[i] = s
            }
            return r.join("\n")
        },
        activate: function () {
            e.fn.editabletypes.text.prototype.activate.call(this)
        }
    }), t.defaults = e.extend({}, e.fn.editabletypes.abstractinput.defaults, {
        tpl: "<textarea></textarea>",
        inputclass: "input-large",
        placeholder: null,
        rows: 7
    }), e.fn.editabletypes.textarea = t
}(window.jQuery),
function (e) {
    var t = function (e) {
        this.init("select", e, t.defaults)
    };
    e.fn.editableutils.inherit(t, e.fn.editabletypes.list), e.extend(t.prototype, {
        renderList: function () {
            this.$input.empty();
            var t = function (n, r) {
                if (e.isArray(r))
                    for (var i = 0; i < r.length; i++) r[i].children ? n.append(t(e("<optgroup>", {
                        label: r[i].text
                    }), r[i].children)) : n.append(e("<option>", {
                        value: r[i].value
                    }).text(r[i].text));
                return n
            };
            t(this.$input, this.sourceData), this.setClass(), this.$input.on("keydown.editable", function (t) {
                t.which === 13 && e(this).closest("form").submit()
            })
        },
        value2htmlFinal: function (t, n) {
            var r = "",
                i = e.fn.editableutils.itemsByValue(t, this.sourceData);
            i.length && (r = i[0].text), e(n).text(r)
        },
        autosubmit: function () {
            this.$input.off("keydown.editable").on("change.editable", function () {
                e(this).closest("form").submit()
            })
        }
    }), t.defaults = e.extend({}, e.fn.editabletypes.list.defaults, {
        tpl: "<select></select>"
    }), e.fn.editabletypes.select = t
}(window.jQuery),
function (e) {
    var t = function (e) {
        this.init("checklist", e, t.defaults)
    };
    e.fn.editableutils.inherit(t, e.fn.editabletypes.list), e.extend(t.prototype, {
        renderList: function () {
            var t, n;
            this.$tpl.empty();
            if (!e.isArray(this.sourceData)) return;
            for (var r = 0; r < this.sourceData.length; r++) t = e("<label>").append(e("<input>", {
                type: "checkbox",
                value: this.sourceData[r].value
            })).append(e("<span>").text(" " + this.sourceData[r].text)), e("<div>").append(t).appendTo(this.$tpl);
            this.$input = this.$tpl.find('input[type="checkbox"]'), this.setClass()
        },
        value2str: function (t) {
            return e.isArray(t) ? t.sort().join(e.trim(this.options.separator)) : ""
        },
        str2value: function (t) {
            var n, r = null;
            return typeof t == "string" && t.length ? (n = new RegExp("\\s*" + e.trim(this.options.separator) + "\\s*"), r = t.split(n)) : e.isArray(t) && (r = t), r
        },
        value2input: function (t) {
            this.$input.prop("checked", !1), e.isArray(t) && t.length && this.$input.each(function (n, r) {
                var i = e(r);
                e.each(t, function (e, t) {
                    i.val() == t && i.prop("checked", !0)
                })
            })
        },
        input2value: function () {
            var t = [];
            return this.$input.filter(":checked").each(function (n, r) {
                t.push(e(r).val())
            }), t
        },
        value2htmlFinal: function (t, n) {
            var r = [],
                i = e.fn.editableutils.itemsByValue(t, this.sourceData);
            i.length ? (e.each(i, function (t, n) {
                r.push(e.fn.editableutils.escape(n.text))
            }), e(n).html(r.join("<br>"))) : e(n).empty()
        },
        activate: function () {
            this.$input.first().focus()
        },
        autosubmit: function () {
            this.$input.on("keydown", function (t) {
                t.which === 13 && e(this).closest("form").submit()
            })
        }
    }), t.defaults = e.extend({}, e.fn.editabletypes.list.defaults, {
        tpl: '<div class="editable-checklist"></div>',
        inputclass: null,
        separator: ","
    }), e.fn.editabletypes.checklist = t
}(window.jQuery),
function (e) {
    var t = function (e) {
        this.init("password", e, t.defaults)
    };
    e.fn.editableutils.inherit(t, e.fn.editabletypes.text), e.extend(t.prototype, {
        value2html: function (t, n) {
            t ? e(n).text("[hidden]") : e(n).empty()
        },
        html2value: function (e) {
            return null
        }
    }), t.defaults = e.extend({}, e.fn.editabletypes.text.defaults, {
        tpl: '<input type="password">'
    }), e.fn.editabletypes.password = t
}(window.jQuery),
function (e) {
    var t = function (e) {
        this.init("email", e, t.defaults)
    };
    e.fn.editableutils.inherit(t, e.fn.editabletypes.text), t.defaults = e.extend({}, e.fn.editabletypes.text.defaults, {
        tpl: '<input type="email">'
    }), e.fn.editabletypes.email = t
}(window.jQuery),
function (e) {
    var t = function (e) {
        this.init("url", e, t.defaults)
    };
    e.fn.editableutils.inherit(t, e.fn.editabletypes.text), t.defaults = e.extend({}, e.fn.editabletypes.text.defaults, {
        tpl: '<input type="url">'
    }), e.fn.editabletypes.url = t
}(window.jQuery),
function (e) {
    var t = function (e) {
        this.init("tel", e, t.defaults)
    };
    e.fn.editableutils.inherit(t, e.fn.editabletypes.text), t.defaults = e.extend({}, e.fn.editabletypes.text.defaults, {
        tpl: '<input type="tel">'
    }), e.fn.editabletypes.tel = t
}(window.jQuery),
function (e) {
    var t = function (e) {
        this.init("number", e, t.defaults)
    };
    e.fn.editableutils.inherit(t, e.fn.editabletypes.text), e.extend(t.prototype, {
        render: function () {
            t.superclass.render.call(this), this.setAttr("min"), this.setAttr("max"), this.setAttr("step")
        }
    }), t.defaults = e.extend({}, e.fn.editabletypes.text.defaults, {
        tpl: '<input type="number">',
        inputclass: "input-mini",
        min: null,
        max: null,
        step: null
    }), e.fn.editabletypes.number = t
}(window.jQuery),
function (e) {
    var t = function (e) {
        this.init("range", e, t.defaults)
    };
    e.fn.editableutils.inherit(t, e.fn.editabletypes.number), e.extend(t.prototype, {
        render: function () {
            this.$input = this.$tpl.filter("input"), this.setClass(), this.setAttr("min"), this.setAttr("max"), this.setAttr("step"), this.$input.on("input", function () {
                e(this).siblings("output").text(e(this).val())
            })
        },
        activate: function () {
            this.$input.focus()
        }
    }), t.defaults = e.extend({}, e.fn.editabletypes.number.defaults, {
        tpl: '<input type="range"><output style="width: 30px; display: inline-block"></output>',
        inputclass: "input-medium"
    }), e.fn.editabletypes.range = t
}(window.jQuery),
function (e) {
    var t = function (n) {
        this.init("select2", n, t.defaults), n.select2 = n.select2 || {};
        var r = this,
            i = {
                placeholder: n.placeholder
            };
        this.isMultiple = n.select2.tags || n.select2.multiple, n.select2.tags || (n.source && (i.data = n.source), i.initSelection = function (t, n) {
            var s = r.str2value(t.val()),
                o = e.fn.editableutils.itemsByValue(s, i.data, "id");
            e.isArray(o) && o.length && !r.isMultiple && (o = o[0]), n(o)
        }), this.options.select2 = e.extend({}, t.defaults.select2, i, n.select2)
    };
    e.fn.editableutils.inherit(t, e.fn.editabletypes.abstractinput), e.extend(t.prototype, {
        render: function () {
            this.setClass(), this.$input.select2(this.options.select2), this.isMultiple && this.$input.on("change", function () {
                e(this).closest("form").parent().triggerHandler("resize")
            })
        },
        value2html: function (t, n) {
            var r = "",
                i;
            this.$input ? i = this.$input.select2("data") : this.options.select2.tags ? i = t : this.options.select2.data && (i = e.fn.editableutils.itemsByValue(t, this.options.select2.data, "id")), e.isArray(i) ? (r = [], e.each(i, function (e, t) {
                r.push(t && typeof t == "object" ? t.text : t)
            })) : i && (r = i.text), r = e.isArray(r) ? r.join(this.options.viewseparator) : r, e(n).text(r)
        },
        html2value: function (e) {
            return this.options.select2.tags ? this.str2value(e, this.options.viewseparator) : null
        },
        value2input: function (e) {
            this.$input.val(e).trigger("change")
        },
        input2value: function () {
            return this.$input.select2("val")
        },
        str2value: function (t, n) {
            if (typeof t != "string" || !this.isMultiple) return t;
            n = n || this.options.select2.separator || e.fn.select2.defaults.separator;
            var r, i, s;
            if (t === null || t.length < 1) return null;
            r = t.split(n);
            for (i = 0, s = r.length; i < s; i += 1) r[i] = e.trim(r[i]);
            return r
        }
    }), t.defaults = e.extend({}, e.fn.editabletypes.abstractinput.defaults, {
        tpl: '<input type="hidden">',
        select2: null,
        placeholder: null,
        source: null,
        viewseparator: ", "
    }), e.fn.editabletypes.select2 = t
}(window.jQuery),
function (e) {
    var t = function (t, n) {
        this.$element = e(t);
        if (!this.$element.is("input")) {
            e.error("Combodate should be applied to INPUT element");
            return
        }
        this.options = e.extend({}, e.fn.combodate.defaults, n, this.$element.data()), this.init()
    };
    t.prototype = {
        constructor: t,
        init: function () {
            this.map = {
                day: ["D", "date"],
                month: ["M", "month"],
                year: ["Y", "year"],
                hour: ["[Hh]", "hours"],
                minute: ["m", "minutes"],
                second: ["s", "seconds"],
                ampm: ["[Aa]", ""]
            }, this.$widget = e('<span class="combodate"></span>').html(this.getTemplate()), this.initCombos(), this.$widget.on("change", "select", e.proxy(function () {
                this.$element.val(this.getValue())
            }, this)), this.$widget.find("select").css("width", "auto"), this.$element.hide().after(this.$widget), this.setValue(this.$element.val() || this.options.value)
        },
        getTemplate: function () {
            var t = this.options.template;
            return e.each(this.map, function (e, n) {
                n = n[0];
                var r = new RegExp(n + "+"),
                    i = n.length > 1 ? n.substring(1, 2) : n;
                t = t.replace(r, "{" + i + "}")
            }), t = t.replace(/ /g, "&nbsp;"), e.each(this.map, function (e, n) {
                n = n[0];
                var r = n.length > 1 ? n.substring(1, 2) : n;
                t = t.replace("{" + r + "}", '<select class="' + e + '"></select>')
            }), t
        },
        initCombos: function () {
            var t = this;
            e.each(this.map, function (e, n) {
                var r = t.$widget.find("." + e),
                    i, s;
                r.length && (t["$" + e] = r, i = "fill" + e.charAt(0).toUpperCase() + e.slice(1), s = t[i](), t["$" + e].html(t.renderItems(s)))
            })
        },
        initItems: function (e) {
            var t = [];
            if (this.options.firstItem === "name") {
                var n = typeof moment.relativeTime[e] == "function" ? moment.relativeTime[e](1, !0, e, !1) : moment.relativeTime[e];
                n = n.split(" ").reverse()[0], t.push(["", n])
            } else this.options.firstItem === "empty" && t.push(["", ""]);
            return t
        },
        renderItems: function (e) {
            var t = [];
            for (var n = 0; n < e.length; n++) t.push('<option value="' + e[n][0] + '">' + e[n][1] + "</option>");
            return t.join("\n")
        },
        fillDay: function () {
            var e = this.initItems("d"),
                t, n, r = this.options.template.indexOf("DD") !== -1;
            for (n = 1; n <= 31; n++) t = r ? this.leadZero(n) : n, e.push([n, t]);
            return e
        },
        fillMonth: function () {
            var e = this.initItems("M"),
                t, n, r = this.options.template.indexOf("MMMM") !== -1,
                i = this.options.template.indexOf("MMM") !== -1,
                s = this.options.template.indexOf("MM") !== -1;
            for (n = 0; n <= 11; n++) r ? t = moment.months[n] : i ? t = moment.monthsShort[n] : s ? t = this.leadZero(n + 1) : t = n + 1, e.push([n, t]);
            return e
        },
        fillYear: function () {
            var e = this.initItems("y"),
                t, n, r = this.options.template.indexOf("YYYY") !== -1;
            for (n = this.options.maxYear; n >= this.options.minYear; n--) t = r ? n : (n + "").substring(2), e.push([n, t]);
            return e
        },
        fillHour: function () {
            var e = this.initItems("h"),
                t, n, r = this.options.template.indexOf("h") !== -1,
                i = this.options.template.indexOf("H") !== -1,
                s = this.options.template.toLowerCase().indexOf("hh") !== -1,
                o = r ? 12 : 23;
            for (n = 0; n <= o; n++) t = s ? this.leadZero(n) : n, e.push([n, t]);
            return e
        },
        fillMinute: function () {
            var e = this.initItems("m"),
                t, n, r = this.options.template.indexOf("mm") !== -1;
            for (n = 0; n <= 59; n += this.options.minuteStep) t = r ? this.leadZero(n) : n, e.push([n, t]);
            return e
        },
        fillSecond: function () {
            var e = this.initItems("s"),
                t, n, r = this.options.template.indexOf("ss") !== -1;
            for (n = 0; n <= 59; n += this.options.secondStep) t = r ? this.leadZero(n) : n, e.push([n, t]);
            return e
        },
        fillAmpm: function () {
            var e = this.options.template.indexOf("a") !== -1,
                t = this.options.template.indexOf("A") !== -1,
                n = [
                    ["am", e ? "am" : "AM"],
                    ["pm", e ? "pm" : "PM"]
                ];
            return n
        },
        getValue: function (t) {
            var n, r = {}, i = this,
                s = !1;
            return e.each(this.map, function (e, t) {
                if (e === "ampm") return;
                var n = e === "day" ? 1 : 0;
                r[e] = i["$" + e] ? parseInt(i["$" + e].val(), 10) : n;
                if (isNaN(r[e])) return s = !0, !1
            }), s ? "" : (this.$ampm && (r.hour = this.$ampm.val() === "am" ? r.hour : r.hour + 12, r.hour === 24 && (r.hour = 0)), n = moment([r.year, r.month, r.day, r.hour, r.minute, r.second]), this.highlight(n), t = t === undefined ? this.options.format : t, t === null ? n.isValid() ? n : null : n.isValid() ? n.format(t) : "")
        },
        setValue: function (t) {
            if (!t) return;
            var n = typeof t == "string" ? moment(t, this.options.format) : moment(t),
                r = this,
                i = {};
            n.isValid() && (e.each(this.map, function (e, t) {
                if (e === "ampm") return;
                i[e] = n[t[1]]()
            }), this.$ampm && (i.hour > 12 ? (i.hour -= 12, i.ampm = "pm") : i.ampm = "am"), e.each(i, function (e, t) {
                r["$" + e] && r["$" + e].val(t)
            }), this.$element.val(n.format(this.options.format)))
        },
        highlight: function (e) {
            e.isValid() ? this.options.errorClass ? this.$widget.removeClass(this.options.errorClass) : this.$widget.find("select").css("border-color", this.borderColor) : this.options.errorClass ? this.$widget.addClass(this.options.errorClass) : (this.borderColor || (this.borderColor = this.$widget.find("select").css("border-color")), this.$widget.find("select").css("border-color", "red"))
        },
        leadZero: function (e) {
            return e <= 9 ? "0" + e : e
        },
        destroy: function () {
            this.$widget.remove(), this.$element.removeData("combodate").show()
        }
    }, e.fn.combodate = function (n) {
        var r, i = Array.apply(null, arguments);
        return i.shift(), n === "getValue" &&
            this.length && (r = this.eq(0).data("combodate")) ? r.getValue.apply(r, i) : this.each(function () {
                var r = e(this),
                    s = r.data("combodate"),
                    o = typeof n == "object" && n;
                s || r.data("combodate", s = new t(this, o)), typeof n == "string" && typeof s[n] == "function" && s[n].apply(s, i)
            })
    }, e.fn.combodate.defaults = {
        format: "DD-MM-YYYY HH:mm",
        template: "D / MMM / YYYY   H : mm",
        value: null,
        minYear: 1970,
        maxYear: 2015,
        minuteStep: 5,
        secondStep: 1,
        firstItem: "empty",
        errorClass: null
    }
}(window.jQuery),
function (e) {
    var t = function (n) {
        this.init("combodate", n, t.defaults), this.options.viewformat || (this.options.viewformat = this.options.format), this.options.combodate = e.extend({}, t.defaults.combodate, n.combodate, {
            format: this.options.format,
            template: this.options.template
        })
    };
    e.fn.editableutils.inherit(t, e.fn.editabletypes.abstractinput), e.extend(t.prototype, {
        render: function () {
            this.$input.combodate(this.options.combodate)
        },
        value2html: function (t, n) {
            var r = t ? t.format(this.options.viewformat) : "";
            e(n).text(r)
        },
        html2value: function (e) {
            return e ? moment(e, this.options.viewformat) : null
        },
        value2str: function (e) {
            return e ? e.format(this.options.format) : ""
        },
        str2value: function (e) {
            return e ? moment(e, this.options.format) : null
        },
        value2submit: function (e) {
            return this.value2str(e)
        },
        value2input: function (e) {
            this.$input.combodate("setValue", e)
        },
        input2value: function () {
            return this.$input.combodate("getValue", null)
        },
        activate: function () {
            this.$input.siblings(".combodate").find("select").eq(0).focus()
        },
        autosubmit: function () {}
    }), t.defaults = e.extend({}, e.fn.editabletypes.abstractinput.defaults, {
        tpl: '<input type="text">',
        inputclass: null,
        format: "YYYY-MM-DD",
        viewformat: null,
        template: "D / MMM / YYYY",
        combodate: null
    }), e.fn.editabletypes.combodate = t
}(window.jQuery),
function (e) {
    e.extend(e.fn.editableform.Constructor.prototype, {
        initTemplate: function () {
            this.$form = e(e.fn.editableform.template), this.$form.find(".editable-error-block").addClass("help-block")
        }
    }), e.fn.editableform.buttons = '<button type="submit" class="btn btn-blue editable-submit"><i class="icon-ok icon-white"></i></button><button type="button" class="btn btn-default editable-cancel"><i class="icon-remove"></i></button>', e.fn.editableform.errorGroupClass = "error", e.fn.editableform.errorBlockClass = null
}(window.jQuery),
function (e) {
    e.extend(e.fn.editableContainer.Popup.prototype, {
        containerName: "popover",
        innerCss: e(e.fn.popover.defaults.template).find("p").length ? ".popover-content p" : ".popover-content",
        initContainer: function () {
            e.extend(this.containerOptions, {
                trigger: "manual",
                selector: !1,
                content: " ",
                template: e.fn.popover.defaults.template
            });
            var t;
            this.$element.data("template") && (t = this.$element.data("template"), this.$element.removeData("template")), this.call(this.containerOptions), t && this.$element.data("template", t)
        },
        innerShow: function () {
            this.call("show")
        },
        innerHide: function () {
            this.call("hide")
        },
        innerDestroy: function () {
            this.call("destroy")
        },
        setContainerOption: function (e, t) {
            this.container().options[e] = t
        },
        setPosition: function () {
            (function () {
                var e = this.tip(),
                    t, n, r, i, s, o;
                s = typeof this.options.placement == "function" ? this.options.placement.call(this, e[0], this.$element[0]) : this.options.placement, t = /in/.test(s), e.removeClass("top right bottom left").css({
                    top: 0,
                    left: 0,
                    display: "block"
                }), n = this.getPosition(t), r = e[0].offsetWidth, i = e[0].offsetHeight;
                switch (t ? s.split(" ")[1] : s) {
                case "bottom":
                    o = {
                        top: n.top + n.height,
                        left: n.left + n.width / 2 - r / 2
                    };
                    break;
                case "top":
                    o = {
                        top: n.top - i,
                        left: n.left + n.width / 2 - r / 2
                    };
                    break;
                case "left":
                    o = {
                        top: n.top + n.height / 2 - i / 2,
                        left: n.left - r
                    };
                    break;
                case "right":
                    o = {
                        top: n.top + n.height / 2 - i / 2,
                        left: n.left + n.width
                    }
                }
                e.offset(o).addClass(s).addClass("in")
            }).call(this.container())
        }
    })
}(window.jQuery),
function (e) {
    var t = function (e) {
        this.init("date", e, t.defaults), this.initPicker(e, t.defaults)
    };
    e.fn.editableutils.inherit(t, e.fn.editabletypes.abstractinput), e.extend(t.prototype, {
        initPicker: function (t, n) {
            this.options.viewformat || (this.options.viewformat = this.options.format), this.options.datepicker = e.extend({}, n.datepicker, t.datepicker, {
                format: this.options.viewformat
            }), this.options.datepicker.language = this.options.datepicker.language || "en", this.dpg = e.fn.datepicker.DPGlobal, this.parsedFormat = this.dpg.parseFormat(this.options.format), this.parsedViewFormat = this.dpg.parseFormat(this.options.viewformat)
        },
        render: function () {
            this.$input.datepicker(this.options.datepicker), this.options.clear && (this.$clear = e('<a href="#"></a>').html(this.options.clear).click(e.proxy(function (e) {
                e.preventDefault(), e.stopPropagation(), this.clear()
            }, this)), this.$tpl.parent().append(e('<div class="editable-clear">').append(this.$clear)))
        },
        value2html: function (e, n) {
            var r = e ? this.dpg.formatDate(e, this.parsedViewFormat, this.options.datepicker.language) : "";
            t.superclass.value2html(r, n)
        },
        html2value: function (e) {
            return e ? this.dpg.parseDate(e, this.parsedViewFormat, this.options.datepicker.language) : null
        },
        value2str: function (e) {
            return e ? this.dpg.formatDate(e, this.parsedFormat, this.options.datepicker.language) : ""
        },
        str2value: function (e) {
            return e ? this.dpg.parseDate(e, this.parsedFormat, this.options.datepicker.language) : null
        },
        value2submit: function (e) {
            return this.value2str(e)
        },
        value2input: function (e) {
            this.$input.datepicker("update", e)
        },
        input2value: function () {
            return this.$input.data("datepicker").date
        },
        activate: function () {},
        clear: function () {
            this.$input.data("datepicker").date = null, this.$input.find(".active").removeClass("active")
        },
        autosubmit: function () {
            this.$input.on("changeDate", function (t) {
                var n = e(this).closest("form");
                setTimeout(function () {
                    n.submit()
                }, 200)
            })
        }
    }), t.defaults = e.extend({}, e.fn.editabletypes.abstractinput.defaults, {
        tpl: '<div class="editable-date well"></div>',
        inputclass: null,
        format: "yyyy-mm-dd",
        viewformat: null,
        datepicker: {
            weekStart: 0,
            startView: 0,
            autoclose: !1
        },
        clear: "&times; clear"
    }), e.fn.editabletypes.date = t
}(window.jQuery),
function (e) {
    var t = function (e) {
        this.init("datefield", e, t.defaults), this.initPicker(e, t.defaults)
    };
    e.fn.editableutils.inherit(t, e.fn.editabletypes.date), e.extend(t.prototype, {
        render: function () {
            this.$input = this.$tpl.find("input"), this.setClass(), this.setAttr("placeholder"), this.$tpl.datepicker(this.options.datepicker), this.$input.off("focus keydown"), this.$input.keyup(e.proxy(function () {
                this.$tpl.removeData("date"), this.$tpl.datepicker("update")
            }, this))
        },
        value2input: function (e) {
            this.$input.val(e ? this.dpg.formatDate(e, this.parsedViewFormat, this.options.datepicker.language) : ""), this.$tpl.datepicker("update")
        },
        input2value: function () {
            return this.html2value(this.$input.val())
        },
        activate: function () {
            e.fn.editabletypes.text.prototype.activate.call(this)
        },
        autosubmit: function () {}
    }), t.defaults = e.extend({}, e.fn.editabletypes.date.defaults, {
        tpl: '<div class="input-append date"><input type="text"/><span class="add-on"><i class="icon-th"></i></span></div>',
        inputclass: "input-small",
        datepicker: {
            weekStart: 0,
            startView: 0,
            autoclose: !0
        }
    }), e.fn.editabletypes.datefield = t
}(window.jQuery), ! function (e) {
    function t() {
        return new Date(Date.UTC.apply(Date, arguments))
    }

    function n() {
        var e = new Date;
        return t(e.getUTCFullYear(), e.getUTCMonth(), e.getUTCDate())
    }
    var r = function (t, n) {
        var r = this;
        this.element = e(t), this.language = n.language || this.element.data("date-language") || "en", this.language = this.language in i ? this.language : "en", this.isRTL = i[this.language].rtl || !1, this.format = s.parseFormat(n.format || this.element.data("date-format") || "mm/dd/yyyy"), this.isInline = !1, this.isInput = this.element.is("input"), this.component = this.element.is(".date") ? this.element.find(".add-on") : !1, this.hasInput = this.component && this.element.find("input").length, this.component && this.component.length === 0 && (this.component = !1), this._attachEvents(), this.forceParse = !0, "forceParse" in n ? this.forceParse = n.forceParse : "dateForceParse" in this.element.data() && (this.forceParse = this.element.data("date-force-parse")), this.picker = e(s.template).appendTo(this.isInline ? this.element : "body").on({
            click: e.proxy(this.click, this),
            mousedown: e.proxy(this.mousedown, this)
        }), this.isInline ? this.picker.addClass("datepicker-inline") : this.picker.addClass("datepicker-dropdown dropdown-menu"), this.isRTL && (this.picker.addClass("datepicker-rtl"), this.picker.find(".prev i, .next i").toggleClass("icon-arrow-left icon-arrow-right")), e(document).on("mousedown", function (t) {
            e(t.target).closest(".datepicker").length === 0 && r.hide()
        }), this.autoclose = !1, "autoclose" in n ? this.autoclose = n.autoclose : "dateAutoclose" in this.element.data() && (this.autoclose = this.element.data("date-autoclose")), this.keyboardNavigation = !0, "keyboardNavigation" in n ? this.keyboardNavigation = n.keyboardNavigation : "dateKeyboardNavigation" in this.element.data() && (this.keyboardNavigation = this.element.data("date-keyboard-navigation")), this.viewMode = this.startViewMode = 0;
        switch (n.startView || this.element.data("date-start-view")) {
        case 2:
        case "decade":
            this.viewMode = this.startViewMode = 2;
            break;
        case 1:
        case "year":
            this.viewMode = this.startViewMode = 1
        }
        this.todayBtn = n.todayBtn || this.element.data("date-today-btn") || !1, this.todayHighlight = n.todayHighlight || this.element.data("date-today-highlight") || !1, this.weekStart = (n.weekStart || this.element.data("date-weekstart") || i[this.language].weekStart || 0) % 7, this.weekEnd = (this.weekStart + 6) % 7, this.startDate = -Infinity, this.endDate = Infinity, this.daysOfWeekDisabled = [], this.setStartDate(n.startDate || this.element.data("date-startdate")), this.setEndDate(n.endDate || this.element.data("date-enddate")), this.setDaysOfWeekDisabled(n.daysOfWeekDisabled || this.element.data("date-days-of-week-disabled")), this.fillDow(), this.fillMonths(), this.update(), this.showMode(), this.isInline && this.show()
    };
    r.prototype = {
        constructor: r,
        _events: [],
        _attachEvents: function () {
            this._detachEvents(), this.isInput ? this._events = [
                [this.element, {
                    focus: e.proxy(this.show, this),
                    keyup: e.proxy(this.update, this),
                    keydown: e.proxy(this.keydown, this)
                }]
            ] : this.component && this.hasInput ? this._events = [
                [this.element.find("input"), {
                    focus: e.proxy(this.show, this),
                    keyup: e.proxy(this.update, this),
                    keydown: e.proxy(this.keydown, this)
                }],
                [this.component, {
                    click: e.proxy(this.show, this)
                }]
            ] : this.element.is("div") ? this.isInline = !0 : this._events = [
                [this.element, {
                    click: e.proxy(this.show, this)
                }]
            ];
            for (var t = 0, n, r; t < this._events.length; t++) n = this._events[t][0], r = this._events[t][1], n.on(r)
        },
        _detachEvents: function () {
            for (var e = 0, t, n; e < this._events.length; e++) t = this._events[e][0], n = this._events[e][1], t.off(n);
            this._events = []
        },
        show: function (t) {
            this.picker.show(), this.height = this.component ? this.component.outerHeight() : this.element.outerHeight(), this.update(), this.place(), e(window).on("resize", e.proxy(this.place, this)), t && (t.stopPropagation(), t.preventDefault()), this.element.trigger({
                type: "show",
                date: this.date
            })
        },
        hide: function (t) {
            if (this.isInline) return;
            this.picker.hide(), e(window).off("resize", this.place), this.viewMode = this.startViewMode, this.showMode(), this.isInput || e(document).off("mousedown", this.hide), this.forceParse && (this.isInput && this.element.val() || this.hasInput && this.element.find("input").val()) && this.setValue(), this.element.trigger({
                type: "hide",
                date: this.date
            })
        },
        remove: function () {
            this._detachEvents(), this.picker.remove(), delete this.element.data().datepicker
        },
        getDate: function () {
            var e = this.getUTCDate();
            return new Date(e.getTime() + e.getTimezoneOffset() * 6e4)
        },
        getUTCDate: function () {
            return this.date
        },
        setDate: function (e) {
            this.setUTCDate(new Date(e.getTime() - e.getTimezoneOffset() * 6e4))
        },
        setUTCDate: function (e) {
            this.date = e, this.setValue()
        },
        setValue: function () {
            var e = this.getFormattedDate();
            this.isInput ? this.element.val(e) : (this.component && this.element.find("input").val(e), this.element.data("date", e))
        },
        getFormattedDate: function (e) {
            return e === undefined && (e = this.format), s.formatDate(this.date, e, this.language)
        },
        setStartDate: function (e) {
            this.startDate = e || -Infinity, this.startDate !== -Infinity && (this.startDate = s.parseDate(this.startDate, this.format, this.language)), this.update(), this.updateNavArrows()
        },
        setEndDate: function (e) {
            this.endDate = e || Infinity, this.endDate !== Infinity && (this.endDate = s.parseDate(this.endDate, this.format, this.language)), this.update(), this.updateNavArrows()
        },
        setDaysOfWeekDisabled: function (t) {
            this.daysOfWeekDisabled = t || [], e.isArray(this.daysOfWeekDisabled) || (this.daysOfWeekDisabled = this.daysOfWeekDisabled.split(/,\s*/)), this.daysOfWeekDisabled = e.map(this.daysOfWeekDisabled, function (e) {
                return parseInt(e, 10)
            }), this.update(), this.updateNavArrows()
        },
        place: function () {
            if (this.isInline) return;
            var t = parseInt(this.element.parents().filter(function () {
                return e(this).css("z-index") != "auto"
            }).first().css("z-index")) + 10,
                n = this.component ? this.component.offset() : this.element.offset(),
                r = this.component ? this.component.outerHeight(!0) : this.element.outerHeight(!0);
            this.picker.css({
                top: n.top + r,
                left: n.left,
                zIndex: t
            })
        },
        update: function () {
            var e, t = !1;
            arguments && arguments.length && (typeof arguments[0] == "string" || arguments[0] instanceof Date) ? (e = arguments[0], t = !0) : e = this.isInput ? this.element.val() : this.element.data("date") || this.element.find("input").val(), this.date = s.parseDate(e, this.format, this.language), t && this.setValue();
            var n = this.viewDate;
            this.date < this.startDate ? this.viewDate = new Date(this.startDate) : this.date > this.endDate ? this.viewDate = new Date(this.endDate) : this.viewDate = new Date(this.date), n && n.getTime() != this.viewDate.getTime() && this.element.trigger({
                type: "changeDate",
                date: this.viewDate
            }), this.fill()
        },
        fillDow: function () {
            var e = this.weekStart,
                t = "<tr>";
            while (e < this.weekStart + 7) t += '<th class="dow">' + i[this.language].daysMin[e++ % 7] + "</th>";
            t += "</tr>", this.picker.find(".datepicker-days thead").append(t)
        },
        fillMonths: function () {
            var e = "",
                t = 0;
            while (t < 12) e += '<span class="month">' + i[this.language].monthsShort[t++] + "</span>";
            this.picker.find(".datepicker-months td").html(e)
        },
        fill: function () {
            var n = new Date(this.viewDate),
                r = n.getUTCFullYear(),
                o = n.getUTCMonth(),
                u = this.startDate !== -Infinity ? this.startDate.getUTCFullYear() : -Infinity,
                a = this.startDate !== -Infinity ? this.startDate.getUTCMonth() : -Infinity,
                f = this.endDate !== Infinity ? this.endDate.getUTCFullYear() : Infinity,
                l = this.endDate !== Infinity ? this.endDate.getUTCMonth() : Infinity,
                c = this.date && this.date.valueOf(),
                h = new Date;
            this.picker.find(".datepicker-days thead th:eq(1)").text(i[this.language].months[o] + " " + r), this.picker.find("tfoot th.today").text(i[this.language].today).toggle(this.todayBtn !== !1), this.updateNavArrows(), this.fillMonths();
            var p = t(r, o - 1, 28, 0, 0, 0, 0),
                d = s.getDaysInMonth(p.getUTCFullYear(), p.getUTCMonth());
            p.setUTCDate(d), p.setUTCDate(d - (p.getUTCDay() - this.weekStart + 7) % 7);
            var v = new Date(p);
            v.setUTCDate(v.getUTCDate() + 42), v = v.valueOf();
            var m = [],
                g;
            while (p.valueOf() < v) {
                p.getUTCDay() == this.weekStart && m.push("<tr>"), g = "";
                if (p.getUTCFullYear() < r || p.getUTCFullYear() == r && p.getUTCMonth() < o) g += " old";
                else if (p.getUTCFullYear() > r || p.getUTCFullYear() == r && p.getUTCMonth() > o) g += " new";
                this.todayHighlight && p.getUTCFullYear() == h.getFullYear() && p.getUTCMonth() == h.getMonth() && p.getUTCDate() == h.getDate() && (g += " today"), c && p.valueOf() == c && (g += " active");
                if (p.valueOf() < this.startDate || p.valueOf() > this.endDate || e.inArray(p.getUTCDay(), this.daysOfWeekDisabled) !== -1) g += " disabled";
                m.push('<td class="day' + g + '">' + p.getUTCDate() + "</td>"), p.getUTCDay() == this.weekEnd && m.push("</tr>"), p.setUTCDate(p.getUTCDate() + 1)
            }
            this.picker.find(".datepicker-days tbody").empty().append(m.join(""));
            var y = this.date && this.date.getUTCFullYear(),
                b = this.picker.find(".datepicker-months").find("th:eq(1)").text(r).end().find("span").removeClass("active");
            y && y == r && b.eq(this.date.getUTCMonth()).addClass("active"), (r < u || r > f) && b.addClass("disabled"), r == u && b.slice(0, a).addClass("disabled"), r == f && b.slice(l + 1).addClass("disabled"), m = "", r = parseInt(r / 10, 10) * 10;
            var w = this.picker.find(".datepicker-years").find("th:eq(1)").text(r + "-" + (r + 9)).end().find("td");
            r -= 1;
            for (var E = -1; E < 11; E++) m += '<span class="year' + (E == -1 || E == 10 ? " old" : "") + (y == r ? " active" : "") + (r < u || r > f ? " disabled" : "") + '">' + r + "</span>", r += 1;
            w.html(m)
        },
        updateNavArrows: function () {
            var e = new Date(this.viewDate),
                t = e.getUTCFullYear(),
                n = e.getUTCMonth();
            switch (this.viewMode) {
            case 0:
                this.startDate !== -Infinity && t <= this.startDate.getUTCFullYear() && n <= this.startDate.getUTCMonth() ? this.picker.find(".prev").css({
                    visibility: "hidden"
                }) : this.picker.find(".prev").css({
                    visibility: "visible"
                }), this.endDate !== Infinity && t >= this.endDate.getUTCFullYear() && n >= this.endDate.getUTCMonth() ? this.picker.find(".next").css({
                    visibility: "hidden"
                }) : this.picker.find(".next").css({
                    visibility: "visible"
                });
                break;
            case 1:
            case 2:
                this.startDate !== -Infinity && t <= this.startDate.getUTCFullYear() ? this.picker.find(".prev").css({
                    visibility: "hidden"
                }) : this.picker.find(".prev").css({
                    visibility: "visible"
                }), this.endDate !== Infinity && t >= this.endDate.getUTCFullYear() ? this.picker.find(".next").css({
                    visibility: "hidden"
                }) : this.picker.find(".next").css({
                    visibility: "visible"
                })
            }
        },
        click: function (n) {
            n.stopPropagation(), n.preventDefault();
            var r = e(n.target).closest("span, td, th");
            if (r.length == 1) switch (r[0].nodeName.toLowerCase()) {
            case "th":
                switch (r[0].className) {
                case "switch":
                    this.showMode(1);
                    break;
                case "prev":
                case "next":
                    var i = s.modes[this.viewMode].navStep * (r[0].className == "prev" ? -1 : 1);
                    switch (this.viewMode) {
                    case 0:
                        this.viewDate = this.moveMonth(this.viewDate, i);
                        break;
                    case 1:
                    case 2:
                        this.viewDate = this.moveYear(this.viewDate, i)
                    }
                    this.fill();
                    break;
                case "today":
                    var o = new Date;
                    o = t(o.getFullYear(), o.getMonth(), o.getDate(), 0, 0, 0), this.showMode(-2);
                    var u = this.todayBtn == "linked" ? null : "view";
                    this._setDate(o, u)
                }
                break;
            case "span":
                if (!r.is(".disabled")) {
                    this.viewDate.setUTCDate(1);
                    if (r.is(".month")) {
                        var a = r.parent().find("span").index(r);
                        this.viewDate.setUTCMonth(a), this.element.trigger({
                            type: "changeMonth",
                            date: this.viewDate
                        })
                    } else {
                        var f = parseInt(r.text(), 10) || 0;
                        this.viewDate.setUTCFullYear(f), this.element.trigger({
                            type: "changeYear",
                            date: this.viewDate
                        })
                    }
                    this.showMode(-1), this.fill()
                }
                break;
            case "td":
                if (r.is(".day") && !r.is(".disabled")) {
                    var l = parseInt(r.text(), 10) || 1,
                        f = this.viewDate.getUTCFullYear(),
                        a = this.viewDate.getUTCMonth();
                    r.is(".old") ? a === 0 ? (a = 11, f -= 1) : a -= 1 : r.is(".new") && (a == 11 ? (a = 0, f += 1) : a += 1), this._setDate(t(f, a, l, 0, 0, 0, 0))
                }
            }
        },
        _setDate: function (e, t) {
            if (!t || t == "date") this.date = e;
            if (!t || t == "view") this.viewDate = e;
            this.fill(), this.setValue(), this.element.trigger({
                type: "changeDate",
                date: this.date
            });
            var n;
            this.isInput ? n = this.element : this.component && (n = this.element.find("input")), n && (n.change(), this.autoclose && (!t || t == "date") && this.hide())
        },
        moveMonth: function (e, t) {
            if (!t) return e;
            var n = new Date(e.valueOf()),
                r = n.getUTCDate(),
                i = n.getUTCMonth(),
                s = Math.abs(t),
                o, u;
            t = t > 0 ? 1 : -1;
            if (s == 1) {
                u = t == -1 ? function () {
                    return n.getUTCMonth() == i
                } : function () {
                    return n.getUTCMonth() != o
                }, o = i + t, n.setUTCMonth(o);
                if (o < 0 || o > 11) o = (o + 12) % 12
            } else {
                for (var a = 0; a < s; a++) n = this.moveMonth(n, t);
                o = n.getUTCMonth(), n.setUTCDate(r), u = function () {
                    return o != n.getUTCMonth()
                }
            }
            while (u()) n.setUTCDate(--r), n.setUTCMonth(o);
            return n
        },
        moveYear: function (e, t) {
            return this.moveMonth(e, t * 12)
        },
        dateWithinRange: function (e) {
            return e >= this.startDate && e <= this.endDate
        },
        keydown: function (e) {
            if (this.picker.is(":not(:visible)")) {
                e.keyCode == 27 && this.show();
                return
            }
            var t = !1,
                n, r, i, s, o;
            switch (e.keyCode) {
            case 27:
                this.hide(), e.preventDefault();
                break;
            case 37:
            case 39:
                if (!this.keyboardNavigation) break;
                n = e.keyCode == 37 ? -1 : 1, e.ctrlKey ? (s = this.moveYear(this.date, n), o = this.moveYear(this.viewDate, n)) : e.shiftKey ? (s = this.moveMonth(this.date, n), o = this.moveMonth(this.viewDate, n)) : (s = new Date(this.date), s.setUTCDate(this.date.getUTCDate() + n), o = new Date(this.viewDate), o.setUTCDate(this.viewDate.getUTCDate() + n)), this.dateWithinRange(s) && (this.date = s, this.viewDate = o, this.setValue(), this.update(), e.preventDefault(), t = !0);
                break;
            case 38:
            case 40:
                if (!this.keyboardNavigation) break;
                n = e.keyCode == 38 ? -1 : 1, e.ctrlKey ? (s = this.moveYear(this.date, n), o = this.moveYear(this.viewDate, n)) : e.shiftKey ? (s = this.moveMonth(this.date, n), o = this.moveMonth(this.viewDate, n)) : (s = new Date(this.date), s.setUTCDate(this.date.getUTCDate() + n * 7), o = new Date(this.viewDate), o.setUTCDate(this.viewDate.getUTCDate() + n * 7)), this.dateWithinRange(s) && (this.date = s, this.viewDate = o, this.setValue(), this.update(), e.preventDefault(), t = !0);
                break;
            case 13:
                this.hide(), e.preventDefault();
                break;
            case 9:
                this.hide()
            }
            if (t) {
                this.element.trigger({
                    type: "changeDate",
                    date: this.date
                });
                var u;
                this.isInput ? u = this.element : this.component && (u = this.element.find("input")), u && u.change()
            }
        },
        showMode: function (e) {
            e && (this.viewMode = Math.max(0, Math.min(2, this.viewMode + e))), this.picker.find(">div").hide().filter(".datepicker-" + s.modes[this.viewMode].clsName).css("display", "block"), this.updateNavArrows()
        }
    }, e.fn.datepicker = function (t) {
        var n = Array.apply(null, arguments);
        return n.shift(), this.each(function () {
            var i = e(this),
                s = i.data("datepicker"),
                o = typeof t == "object" && t;
            s || i.data("datepicker", s = new r(this, e.extend({}, e.fn.datepicker.defaults, o))), typeof t == "string" && typeof s[t] == "function" && s[t].apply(s, n)
        })
    }, e.fn.datepicker.defaults = {}, e.fn.datepicker.Constructor = r;
    var i = e.fn.datepicker.dates = {
        en: {
            days: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"],
            daysShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"],
            daysMin: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa", "Su"],
            months: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],
            monthsShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
            today: "Today"
        }
    }, s = {
            modes: [{
                clsName: "days",
                navFnc: "Month",
                navStep: 1
            }, {
                clsName: "months",
                navFnc: "FullYear",
                navStep: 1
            }, {
                clsName: "years",
                navFnc: "FullYear",
                navStep: 10
            }],
            isLeapYear: function (e) {
                return e % 4 === 0 && e % 100 !== 0 || e % 400 === 0
            },
            getDaysInMonth: function (e, t) {
                return [31, s.isLeapYear(e) ? 29 : 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][t]
            },
            validParts: /dd?|DD?|mm?|MM?|yy(?:yy)?/g,
            nonpunctuation: /[^ -\/:-@\[\u3400-\u9fff-`{-~\t\n\r]+/g,
            parseFormat: function (e) {
                var t = e.replace(this.validParts, "\0").split("\0"),
                    n = e.match(this.validParts);
                if (!t || !t.length || !n || n.length === 0) throw new Error("Invalid date format.");
                return {
                    separators: t,
                    parts: n
                }
            },
            parseDate: function (n, s, o) {
                if (n instanceof Date) return n;
                if (/^[\-+]\d+[dmwy]([\s,]+[\-+]\d+[dmwy])*$/.test(n)) {
                    var u = /([\-+]\d+)([dmwy])/,
                        a = n.match(/([\-+]\d+)([dmwy])/g),
                        f, l;
                    n = new Date;
                    for (var c = 0; c < a.length; c++) {
                        f = u.exec(a[c]), l = parseInt(f[1]);
                        switch (f[2]) {
                        case "d":
                            n.setUTCDate(n.getUTCDate() + l);
                            break;
                        case "m":
                            n = r.prototype.moveMonth.call(r.prototype, n, l);
                            break;
                        case "w":
                            n.setUTCDate(n.getUTCDate() + l * 7);
                            break;
                        case "y":
                            n = r.prototype.moveYear.call(r.prototype, n, l)
                        }
                    }
                    return t(n.getUTCFullYear(), n.getUTCMonth(), n.getUTCDate(), 0, 0, 0)
                }
                var a = n && n.match(this.nonpunctuation) || [],
                    n = new Date,
                    h = {}, p = ["yyyy", "yy", "M", "MM", "m", "mm", "d", "dd"],
                    d = {
                        yyyy: function (e, t) {
                            return e.setUTCFullYear(t)
                        },
                        yy: function (e, t) {
                            return e.setUTCFullYear(2e3 + t)
                        },
                        m: function (e, t) {
                            t -= 1;
                            while (t < 0) t += 12;
                            t %= 12, e.setUTCMonth(t);
                            while (e.getUTCMonth() != t) e.setUTCDate(e.getUTCDate() - 1);
                            return e
                        },
                        d: function (e, t) {
                            return e.setUTCDate(t)
                        }
                    }, v, m, f;
                d.M = d.MM = d.mm = d.m, d.dd = d.d, n = t(n.getFullYear(), n.getMonth(), n.getDate(), 0, 0, 0);
                var g = s.parts.slice();
                a.length != g.length && (g = e(g).filter(function (t, n) {
                    return e.inArray(n, p) !== -1
                }).toArray());
                if (a.length == g.length) {
                    for (var c = 0, y = g.length; c < y; c++) {
                        v = parseInt(a[c], 10), f = g[c];
                        if (isNaN(v)) switch (f) {
                        case "MM":
                            m = e(i[o].months).filter(function () {
                                var e = this.slice(0, a[c].length),
                                    t = a[c].slice(0, e.length);
                                return e == t
                            }), v = e.inArray(m[0], i[o].months) + 1;
                            break;
                        case "M":
                            m = e(i[o].monthsShort).filter(function () {
                                var e = this.slice(0, a[c].length),
                                    t = a[c].slice(0, e.length);
                                return e == t
                            }), v = e.inArray(m[0], i[o].monthsShort) + 1
                        }
                        h[f] = v
                    }
                    for (var c = 0, b; c < p.length; c++) b = p[c], b in h && !isNaN(h[b]) && d[b](n, h[b])
                }
                return n
            },
            formatDate: function (t, n, r) {
                var s = {
                    d: t.getUTCDate(),
                    D: i[r].daysShort[t.getUTCDay()],
                    DD: i[r].days[t.getUTCDay()],
                    m: t.getUTCMonth() + 1,
                    M: i[r].monthsShort[t.getUTCMonth()],
                    MM: i[r].months[t.getUTCMonth()],
                    yy: t.getUTCFullYear().toString().substring(2),
                    yyyy: t.getUTCFullYear()
                };
                s.dd = (s.d < 10 ? "0" : "") + s.d, s.mm = (s.m < 10 ? "0" : "") + s.m;
                var t = [],
                    o = e.extend([], n.separators);
                for (var u = 0, a = n.parts.length; u < a; u++) o.length && t.push(o.shift()), t.push(s[n.parts[u]]);
                return t.join("")
            },
            headTemplate: '<thead><tr><th class="prev"><i class="icon-arrow-left"/></th><th colspan="5" class="switch"></th><th class="next"><i class="icon-arrow-right"/></th></tr></thead>',
            contTemplate: '<tbody><tr><td colspan="7"></td></tr></tbody>',
            footTemplate: '<tfoot><tr><th colspan="7" class="today"></th></tr></tfoot>'
        };
    s.template = '<div class="datepicker"><div class="datepicker-days"><table class=" table-condensed">' + s.headTemplate + "<tbody></tbody>" + s.footTemplate + "</table>" + "</div>" + '<div class="datepicker-months">' + '<table class="table-condensed">' + s.headTemplate + s.contTemplate + s.footTemplate + "</table>" + "</div>" + '<div class="datepicker-years">' + '<table class="table-condensed">' + s.headTemplate + s.contTemplate + s.footTemplate + "</table>" + "</div>" + "</div>", e.fn.datepicker.DPGlobal = s
}(window.jQuery),
function (e) {
    var t = function (n) {
        this.init("typeahead", n, t.defaults), this.options.typeahead = e.extend({}, t.defaults.typeahead, {
            matcher: this.matcher,
            sorter: this.sorter,
            highlighter: this.highlighter,
            updater: this.updater
        }, n.typeahead)
    };
    e.fn.editableutils.inherit(t, e.fn.editabletypes.list), e.extend(t.prototype, {
        renderList: function () {
            this.$input = this.$tpl.is("input") ? this.$tpl : this.$tpl.find('input[type="text"]'), this.options.typeahead.source = this.sourceData, this.$input.typeahead(this.options.typeahead), this.$input.data("typeahead").render = e.proxy(this.typeaheadRender, this.$input.data("typeahead")), this.renderClear(), this.setClass(), this.setAttr("placeholder")
        },
        value2htmlFinal: function (t, n) {
            if (this.getIsObjects()) {
                var r = e.fn.editableutils.itemsByValue(t, this.sourceData);
                e(n).text(r.length ? r[0].text : "")
            } else e(n).text(t)
        },
        html2value: function (e) {
            return e ? e : null
        },
        value2input: function (t) {
            if (this.getIsObjects()) {
                var n = e.fn.editableutils.itemsByValue(t, this.sourceData);
                this.$input.data("value", t).val(n.length ? n[0].text : "")
            } else this.$input.val(t)
        },
        input2value: function () {
            if (this.getIsObjects()) {
                var t = this.$input.data("value"),
                    n = e.fn.editableutils.itemsByValue(t, this.sourceData);
                return n.length && n[0].text.toLowerCase() === this.$input.val().toLowerCase() ? t : null
            }
            return this.$input.val()
        },
        getIsObjects: function () {
            if (this.isObjects === undefined) {
                this.isObjects = !1;
                for (var e = 0; e < this.sourceData.length; e++)
                    if (this.sourceData[e].value !== this.sourceData[e].text) {
                        this.isObjects = !0;
                        break
                    }
            }
            return this.isObjects
        },
        activate: e.fn.editabletypes.text.prototype.activate,
        renderClear: e.fn.editabletypes.text.prototype.renderClear,
        postrender: e.fn.editabletypes.text.prototype.postrender,
        toggleClear: e.fn.editabletypes.text.prototype.toggleClear,
        clear: function () {
            e.fn.editabletypes.text.prototype.clear.call(this), this.$input.data("value", "")
        },
        matcher: function (t) {
            return e.fn.typeahead.Constructor.prototype.matcher.call(this, t.text)
        },
        sorter: function (e) {
            var t = [],
                n = [],
                r = [],
                i, s;
            while (i = e.shift()) s = i.text, s.toLowerCase().indexOf(this.query.toLowerCase()) ? ~s.indexOf(this.query) ? n.push(i) : r.push(i) : t.push(i);
            return t.concat(n, r)
        },
        highlighter: function (t) {
            return e.fn.typeahead.Constructor.prototype.highlighter.call(this, t.text)
        },
        updater: function (e) {
            return e = this.$menu.find(".active").data("item"), this.$element.data("value", e.value), e.text
        },
        typeaheadRender: function (t) {
            var n = this;
            return t = e(t).map(function (t, r) {
                return t = e(n.options.item).data("item", r), t.find("a").html(n.highlighter(r)), t[0]
            }), t.first().addClass("active"), this.$menu.html(t), this
        }
    }), t.defaults = e.extend({}, e.fn.editabletypes.list.defaults, {
        tpl: '<input type="text">',
        typeahead: null,
        clear: !0
    }), e.fn.editabletypes.typeahead = t
}(window.jQuery),
function (e) {
    var t = function (e) {
        this.init("address", e, t.defaults)
    };
    e.fn.editableutils.inherit(t, e.fn.editabletypes.abstractinput), e.extend(t.prototype, {
        render: function () {
            this.$input = this.$tpl.find("input")
        },
        value2html: function (t, n) {
            if (!t) {
                e(n).empty();
                return
            }
            var r = e("<div>").text(t.city).html() + ", " + e("<div>").text(t.street).html() + " st., bld. " + e("<div>").text(t.building).html();
            e(n).html(r)
        },
        html2value: function (e) {
            return null
        },
        value2str: function (e) {
            var t = "";
            if (e)
                for (var n in e) t = t + n + ":" + e[n] + ";";
            return t
        },
        str2value: function (e) {
            return e
        },
        value2input: function (e) {
            this.$input.filter('[name="city"]').val(e.city), this.$input.filter('[name="street"]').val(e.street), this.$input.filter('[name="building"]').val(e.building)
        },
        input2value: function () {
            return {
                city: this.$input.filter('[name="city"]').val(),
                street: this.$input.filter('[name="street"]').val(),
                building: this.$input.filter('[name="building"]').val()
            }
        },
        activate: function () {
            this.$input.filter('[name="city"]').focus()
        },
        autosubmit: function () {
            this.$input.keydown(function (t) {
                t.which === 13 && e(this).closest("form").submit()
            })
        }
    }), t.defaults = e.extend({}, e.fn.editabletypes.abstractinput.defaults, {
        tpl: '<div class="editable-address"><label><span>City: </span><input type="text" name="city" class="input-small"></label></div><div class="editable-address"><label><span>Street: </span><input type="text" name="street" class="input-small"></label></div><div class="editable-address"><label><span>Building: </span><input type="text" name="building" class="input-mini"></label></div>',
        inputclass: ""
    }), e.fn.editabletypes.address = t
}(window.jQuery), $(function () {
    $("#username").editable({
        type: "text",
        pk: 1,
        name: "username",
        title: "Enter username"
    }), $("#firstname").editable({
        validate: function (e) {
            if ($.trim(e) == "") return "This field is required"
        }
    }), $("#sex").editable({
        prepend: "not selected",
        source: [{
            value: 1,
            text: "Male"
        }, {
            value: 2,
            text: "Female"
        }],
        display: function (e, t) {
            var n = {
                "": "gray",
                1: "green",
                2: "blue"
            }, r = $.grep(t, function (t) {
                    return t.value == e
                });
            r.length ? $(this).text(r[0].text).css("color", n[e]) : $(this).empty()
        }
    }), $("#status").editable(), $("#group").editable({
        showbuttons: !1
    }), $("#vacation").editable(), $("#dob").editable(), $("#event").editable({
        placement: "right",
        combodate: {
            firstItem: "name"
        }
    }), $("#comments").editable({
        showbuttons: !0
    }), $("#note").editable(), $("#pencil").click(function (e) {
        e.stopPropagation(), e.preventDefault(), $("#note").editable("toggle")
    }), $("#state").editable({
        source: ["Alabama", "Alaska", "Arizona", "Arkansas", "California", "Colorado", "Connecticut", "Delaware", "Florida", "Georgia", "Hawaii", "Idaho", "Illinois", "Indiana", "Iowa", "Kansas", "Kentucky", "Louisiana", "Maine", "Maryland", "Massachusetts", "Michigan", "Minnesota", "Mississippi", "Missouri", "Montana", "Nebraska", "Nevada", "New Hampshire", "New Jersey", "New Mexico", "New York", "North Dakota", "North Carolina", "Ohio", "Oklahoma", "Oregon", "Pennsylvania", "Rhode Island", "South Carolina", "South Dakota", "Tennessee", "Texas", "Utah", "Vermont", "Virginia", "Washington", "West Virginia", "Wisconsin", "Wyoming"]
    }), $("#fruits").editable({
        pk: 1,
        limit: 3,
        source: [{
            value: 1,
            text: "banana"
        }, {
            value: 2,
            text: "peach"
        }, {
            value: 3,
            text: "apple"
        }, {
            value: 4,
            text: "watermelon"
        }, {
            value: 5,
            text: "orange"
        }]
    }), $("#tags").editable({
        inputclass: "input-large",
        select2: {
            tags: ["html", "javascript", "css", "ajax"],
            tokenSeparators: [",", " "]
        }
    });
    var e = [];
    $.each({
        BD: "Bangladesh",
        BE: "Belgium",
        BF: "Burkina Faso",
        BG: "Bulgaria",
        BA: "Bosnia and Herzegovina",
        BB: "Barbados",
        WF: "Wallis and Futuna",
        BL: "Saint Bartelemey",
        BM: "Bermuda",
        BN: "Brunei Darussalam",
        BO: "Bolivia",
        BH: "Bahrain",
        BI: "Burundi",
        BJ: "Benin",
        BT: "Bhutan",
        JM: "Jamaica",
        BV: "Bouvet Island",
        BW: "Botswana",
        WS: "Samoa",
        BR: "Brazil",
        BS: "Bahamas",
        JE: "Jersey",
        BY: "Belarus",
        O1: "Other Country",
        LV: "Latvia",
        RW: "Rwanda",
        RS: "Serbia",
        TL: "Timor-Leste",
        RE: "Reunion",
        LU: "Luxembourg",
        TJ: "Tajikistan",
        RO: "Romania",
        PG: "Papua New Guinea",
        GW: "Guinea-Bissau",
        GU: "Guam",
        GT: "Guatemala",
        GS: "South Georgia and the South Sandwich Islands",
        GR: "Greece",
        GQ: "Equatorial Guinea",
        GP: "Guadeloupe",
        JP: "Japan",
        GY: "Guyana",
        GG: "Guernsey",
        GF: "French Guiana",
        GE: "Georgia",
        GD: "Grenada",
        GB: "United Kingdom",
        GA: "Gabon",
        SV: "El Salvador",
        GN: "Guinea",
        GM: "Gambia",
        GL: "Greenland",
        GI: "Gibraltar",
        GH: "Ghana",
        OM: "Oman",
        TN: "Tunisia",
        JO: "Jordan",
        HR: "Croatia",
        HT: "Haiti",
        HU: "Hungary",
        HK: "Hong Kong",
        HN: "Honduras",
        HM: "Heard Island and McDonald Islands",
        VE: "Venezuela",
        PR: "Puerto Rico",
        PS: "Palestinian Territory",
        PW: "Palau",
        PT: "Portugal",
        SJ: "Svalbard and Jan Mayen",
        PY: "Paraguay",
        IQ: "Iraq",
        PA: "Panama",
        PF: "French Polynesia",
        BZ: "Belize",
        PE: "Peru",
        PK: "Pakistan",
        PH: "Philippines",
        PN: "Pitcairn",
        TM: "Turkmenistan",
        PL: "Poland",
        PM: "Saint Pierre and Miquelon",
        ZM: "Zambia",
        EH: "Western Sahara",
        RU: "Russian Federation",
        EE: "Estonia",
        EG: "Egypt",
        TK: "Tokelau",
        ZA: "South Africa",
        EC: "Ecuador",
        IT: "Italy",
        VN: "Vietnam",
        SB: "Solomon Islands",
        EU: "Europe",
        ET: "Ethiopia",
        SO: "Somalia",
        ZW: "Zimbabwe",
        SA: "Saudi Arabia",
        ES: "Spain",
        ER: "Eritrea",
        ME: "Montenegro",
        MD: "Moldova, Republic of",
        MG: "Madagascar",
        MF: "Saint Martin",
        MA: "Morocco",
        MC: "Monaco",
        UZ: "Uzbekistan",
        MM: "Myanmar",
        ML: "Mali",
        MO: "Macao",
        MN: "Mongolia",
        MH: "Marshall Islands",
        MK: "Macedonia",
        MU: "Mauritius",
        MT: "Malta",
        MW: "Malawi",
        MV: "Maldives",
        MQ: "Martinique",
        MP: "Northern Mariana Islands",
        MS: "Montserrat",
        MR: "Mauritania",
        IM: "Isle of Man",
        UG: "Uganda",
        TZ: "Tanzania, United Republic of",
        MY: "Malaysia",
        MX: "Mexico",
        IL: "Israel",
        FR: "France",
        IO: "British Indian Ocean Territory",
        FX: "France, Metropolitan",
        SH: "Saint Helena",
        FI: "Finland",
        FJ: "Fiji",
        FK: "Falkland Islands (Malvinas)",
        FM: "Micronesia, Federated States of",
        FO: "Faroe Islands",
        NI: "Nicaragua",
        NL: "Netherlands",
        NO: "Norway",
        NA: "Namibia",
        VU: "Vanuatu",
        NC: "New Caledonia",
        NE: "Niger",
        NF: "Norfolk Island",
        NG: "Nigeria",
        NZ: "New Zealand",
        NP: "Nepal",
        NR: "Nauru",
        NU: "Niue",
        CK: "Cook Islands",
        CI: "Cote d'Ivoire",
        CH: "Switzerland",
        CO: "Colombia",
        CN: "China",
        CM: "Cameroon",
        CL: "Chile",
        CC: "Cocos (Keeling) Islands",
        CA: "Canada",
        CG: "Congo",
        CF: "Central African Republic",
        CD: "Congo, The Democratic Republic of the",
        CZ: "Czech Republic",
        CY: "Cyprus",
        CX: "Christmas Island",
        CR: "Costa Rica",
        CV: "Cape Verde",
        CU: "Cuba",
        SZ: "Swaziland",
        SY: "Syrian Arab Republic",
        KG: "Kyrgyzstan",
        KE: "Kenya",
        SR: "Suriname",
        KI: "Kiribati",
        KH: "Cambodia",
        KN: "Saint Kitts and Nevis",
        KM: "Comoros",
        ST: "Sao Tome and Principe",
        SK: "Slovakia",
        KR: "Korea, Republic of",
        SI: "Slovenia",
        KP: "Korea, Democratic People's Republic of",
        KW: "Kuwait",
        SN: "Senegal",
        SM: "San Marino",
        SL: "Sierra Leone",
        SC: "Seychelles",
        KZ: "Kazakhstan",
        KY: "Cayman Islands",
        SG: "Singapore",
        SE: "Sweden",
        SD: "Sudan",
        DO: "Dominican Republic",
        DM: "Dominica",
        DJ: "Djibouti",
        DK: "Denmark",
        VG: "Virgin Islands, British",
        DE: "Germany",
        YE: "Yemen",
        DZ: "Algeria",
        US: "United States",
        UY: "Uruguay",
        YT: "Mayotte",
        UM: "United States Minor Outlying Islands",
        LB: "Lebanon",
        LC: "Saint Lucia",
        LA: "Lao People's Democratic Republic",
        TV: "Tuvalu",
        TW: "Taiwan",
        TT: "Trinidad and Tobago",
        TR: "Turkey",
        LK: "Sri Lanka",
        LI: "Liechtenstein",
        A1: "Anonymous Proxy",
        TO: "Tonga",
        LT: "Lithuania",
        A2: "Satellite Provider",
        LR: "Liberia",
        LS: "Lesotho",
        TH: "Thailand",
        TF: "French Southern Territories",
        TG: "Togo",
        TD: "Chad",
        TC: "Turks and Caicos Islands",
        LY: "Libyan Arab Jamahiriya",
        VA: "Holy See (Vatican City State)",
        VC: "Saint Vincent and the Grenadines",
        AE: "United Arab Emirates",
        AD: "Andorra",
        AG: "Antigua and Barbuda",
        AF: "Afghanistan",
        AI: "Anguilla",
        VI: "Virgin Islands, U.S.",
        IS: "Iceland",
        IR: "Iran, Islamic Republic of",
        AM: "Armenia",
        AL: "Albania",
        AO: "Angola",
        AN: "Netherlands Antilles",
        AQ: "Antarctica",
        AP: "Asia/Pacific Region",
        AS: "American Samoa",
        AR: "Argentina",
        AU: "Australia",
        AT: "Austria",
        AW: "Aruba",
        IN: "India",
        AX: "Aland Islands",
        AZ: "Azerbaijan",
        IE: "Ireland",
        ID: "Indonesia",
        UA: "Ukraine",
        QA: "Qatar",
        MZ: "Mozambique"
    }, function (t, n) {
        e.push({
            id: t,
            text: n
        })
    }), $("#country").editable({
        inputclass: "input-large",
        source: e
    }), $("#address").editable({
        value: {
            city: "Moscow",
            street: "Lenina",
            building: "12"
        },
        validate: function (e) {
            if (e.city == "") return "city is required!"
        },
        display: function (e) {
            if (!e) {
                $(this).empty();
                return
            }
            var t = "<b>" + $("<div>").text(e.city).html() + "</b>, " + $("<div>").text(e.street).html() + " st., bld. " + $("<div>").text(e.building).html();
            $(this).html(t)
        }
    }), $("#user .editable").on("hidden", function (e, t) {
        if (t === "save" || t === "nochange") {
            var n = $(this).closest("tr").next().find(".editable");
            $("#autoopen").is(":checked") ? setTimeout(function () {
                n.editable("show")
            }, 300) : n.focus()
        }
    })
}), jQuery.easing.jswing = jQuery.easing.swing, jQuery.extend(jQuery.easing, {
    def: "easeOutQuad",
    swing: function (e, t, n, r, i) {
        return jQuery.easing[jQuery.easing.def](e, t, n, r, i)
    },
    easeInQuad: function (e, t, n, r, i) {
        return r * (t /= i) * t + n
    },
    easeOutQuad: function (e, t, n, r, i) {
        return -r * (t /= i) * (t - 2) + n
    },
    easeInOutQuad: function (e, t, n, r, i) {
        return (t /= i / 2) < 1 ? r / 2 * t * t + n : -r / 2 * (--t * (t - 2) - 1) + n
    },
    easeInCubic: function (e, t, n, r, i) {
        return r * (t /= i) * t * t + n
    },
    easeOutCubic: function (e, t, n, r, i) {
        return r * ((t = t / i - 1) * t * t + 1) + n
    },
    easeInOutCubic: function (e, t, n, r, i) {
        return (t /= i / 2) < 1 ? r / 2 * t * t * t + n : r / 2 * ((t -= 2) * t * t + 2) + n
    },
    easeInQuart: function (e, t, n, r, i) {
        return r * (t /= i) * t * t * t + n
    },
    easeOutQuart: function (e, t, n, r, i) {
        return -r * ((t = t / i - 1) * t * t * t - 1) + n
    },
    easeInOutQuart: function (e, t, n, r, i) {
        return (t /= i / 2) < 1 ? r / 2 * t * t * t * t + n : -r / 2 * ((t -= 2) * t * t * t - 2) + n
    },
    easeInQuint: function (e, t, n, r, i) {
        return r * (t /= i) * t * t * t * t + n
    },
    easeOutQuint: function (e, t, n, r, i) {
        return r * ((t = t / i - 1) * t * t * t * t + 1) + n
    },
    easeInOutQuint: function (e, t, n, r, i) {
        return (t /= i / 2) < 1 ? r / 2 * t * t * t * t * t + n : r / 2 * ((t -= 2) * t * t * t * t + 2) + n
    },
    easeInSine: function (e, t, n, r, i) {
        return -r * Math.cos(t / i * (Math.PI / 2)) + r + n
    },
    easeOutSine: function (e, t, n, r, i) {
        return r * Math.sin(t / i * (Math.PI / 2)) + n
    },
    easeInOutSine: function (e, t, n, r, i) {
        return -r / 2 * (Math.cos(Math.PI * t / i) - 1) + n
    },
    easeInExpo: function (e, t, n, r, i) {
        return t == 0 ? n : r * Math.pow(2, 10 * (t / i - 1)) + n
    },
    easeOutExpo: function (e, t, n, r, i) {
        return t == i ? n + r : r * (-Math.pow(2, -10 * t / i) + 1) + n
    },
    easeInOutExpo: function (e, t, n, r, i) {
        return t == 0 ? n : t == i ? n + r : (t /= i / 2) < 1 ? r / 2 * Math.pow(2, 10 * (t - 1)) + n : r / 2 * (-Math.pow(2, -10 * --t) + 2) + n
    },
    easeInCirc: function (e, t, n, r, i) {
        return -r * (Math.sqrt(1 - (t /= i) * t) - 1) + n
    },
    easeOutCirc: function (e, t, n, r, i) {
        return r * Math.sqrt(1 - (t = t / i - 1) * t) + n
    },
    easeInOutCirc: function (e, t, n, r, i) {
        return (t /= i / 2) < 1 ? -r / 2 * (Math.sqrt(1 - t * t) - 1) + n : r / 2 * (Math.sqrt(1 - (t -= 2) * t) + 1) + n
    },
    easeInElastic: function (e, t, n, r, i) {
        var s = 1.70158,
            o = 0,
            u = r;
        if (t == 0) return n;
        if ((t /= i) == 1) return n + r;
        o || (o = i * .3);
        if (u < Math.abs(r)) {
            u = r;
            var s = o / 4
        } else var s = o / (2 * Math.PI) * Math.asin(r / u);
        return -(u * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * i - s) * 2 * Math.PI / o)) + n
    },
    easeOutElastic: function (e, t, n, r, i) {
        var s = 1.70158,
            o = 0,
            u = r;
        if (t == 0) return n;
        if ((t /= i) == 1) return n + r;
        o || (o = i * .3);
        if (u < Math.abs(r)) {
            u = r;
            var s = o / 4
        } else var s = o / (2 * Math.PI) * Math.asin(r / u);
        return u * Math.pow(2, -10 * t) * Math.sin((t * i - s) * 2 * Math.PI / o) + r + n
    },
    easeInOutElastic: function (e, t, n, r, i) {
        var s = 1.70158,
            o = 0,
            u = r;
        if (t == 0) return n;
        if ((t /= i / 2) == 2) return n + r;
        o || (o = i * .3 * 1.5);
        if (u < Math.abs(r)) {
            u = r;
            var s = o / 4
        } else var s = o / (2 * Math.PI) * Math.asin(r / u);
        return t < 1 ? -0.5 * u * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * i - s) * 2 * Math.PI / o) + n : u * Math.pow(2, -10 * (t -= 1)) * Math.sin((t * i - s) * 2 * Math.PI / o) * .5 + r + n
    },
    easeInBack: function (e, t, n, r, i, s) {
        return s == undefined && (s = 1.70158), r * (t /= i) * t * ((s + 1) * t - s) + n
    },
    easeOutBack: function (e, t, n, r, i, s) {
        return s == undefined && (s = 1.70158), r * ((t = t / i - 1) * t * ((s + 1) * t + s) + 1) + n
    },
    easeInOutBack: function (e, t, n, r, i, s) {
        return s == undefined && (s = 1.70158), (t /= i / 2) < 1 ? r / 2 * t * t * (((s *= 1.525) + 1) * t - s) + n : r / 2 * ((t -= 2) * t * (((s *= 1.525) + 1) * t + s) + 2) + n
    },
    easeInBounce: function (e, t, n, r, i) {
        return r - jQuery.easing.easeOutBounce(e, i - t, 0, r, i) + n
    },
    easeOutBounce: function (e, t, n, r, i) {
        return (t /= i) < 1 / 2.75 ? r * 7.5625 * t * t + n : t < 2 / 2.75 ? r * (7.5625 * (t -= 1.5 / 2.75) * t + .75) + n : t < 2.5 / 2.75 ? r * (7.5625 * (t -= 2.25 / 2.75) * t + .9375) + n : r * (7.5625 * (t -= 2.625 / 2.75) * t + .984375) + n
    },
    easeInOutBounce: function (e, t, n, r, i) {
        return t < i / 2 ? jQuery.easing.easeInBounce(e, t * 2, 0, r, i) * .5 + n : jQuery.easing.easeOutBounce(e, t * 2 - i, 0, r, i) * .5 + r * .5 + n
    }
}),
function ($) {
    $.extend({
        metadata: {
            defaults: {
                type: "class",
                name: "metadata",
                cre: /({.*})/,
                single: "metadata"
            },
            setType: function (e, t) {
                this.defaults.type = e, this.defaults.name = t
            },
            get: function (elem, opts) {
                var settings = $.extend({}, this.defaults, opts);
                settings.single.length || (settings.single = "metadata");
                var data = $.data(elem, settings.single);
                if (data) return data;
                data = "{}";
                if (settings.type == "class") {
                    var m = settings.cre.exec(elem.className);
                    m && (data = m[1])
                } else if (settings.type == "elem") {
                    if (!elem.getElementsByTagName) return undefined;
                    var e = elem.getElementsByTagName(settings.name);
                    e.length && (data = $.trim(e[0].innerHTML))
                } else if (elem.getAttribute != undefined) {
                    var attr = elem.getAttribute(settings.name);
                    attr && (data = attr)
                }
                return data.indexOf("{") < 0 && (data = "{" + data + "}"), data = eval("(" + data + ")"), $.data(elem, settings.single, data), data
            }
        }
    }), $.fn.metadata = function (e) {
        return $.metadata.get(this[0], e)
    }
}(jQuery),
function (e) {
    e.iButton = {
        version: "1.0.03",
        setDefaults: function (t) {
            e.extend(r, t)
        }
    }, e.fn.iButton = function (t) {
        var r = typeof arguments[0] == "string" && arguments[0],
            i = r && Array.prototype.slice.call(arguments, 1) || arguments,
            s = this.length == 0 ? null : e.data(this[0], "iButton");
        if (s && r && this.length) {
            if (r.toLowerCase() == "object") return s;
            if (s[r]) {
                var o;
                return this.each(function (t) {
                    var n = e.data(this, "iButton")[r].apply(s, i);
                    if (t == 0 && n) {
                        if (!n.jquery) return o = n, !1;
                        o = e([]).add(n)
                    } else !!n && !! n.jquery && (o = o.add(n))
                }), o || this
            }
            return this
        }
        return this.each(function () {
            new n(this, t)
        })
    };
    var t = 0;
    e.browser.iphone = navigator.userAgent.toLowerCase().indexOf("iphone") > -1;
    var n = function (n, o) {
        var u = this,
            a = e(n),
            f = ++t,
            l = !1,
            c = {}, h = {
                dragging: !1,
                clicked: null
            }, p = {
                position: null,
                offset: null,
                time: null
            }, o = e.extend({}, r, o, e.metadata ? a.metadata() : {}),
            d = o.labelOn == i && o.labelOff == s,
            v = ":checkbox, :radio";
        if (!a.is(v)) return a.find(v).iButton(o);
        if (e.data(a[0], "iButton")) return;
        e.data(a[0], "iButton", u), o.resizeHandle == "auto" && (o.resizeHandle = !d), o.resizeContainer == "auto" && (o.resizeContainer = !d), this.toggle = function (e) {
            var t = arguments.length > 0 ? e : !a[0].checked;
            a.attr("checked", t).trigger("change")
        }, this.disable = function (t) {
            var n = arguments.length > 0 ? t : !l;
            l = n, a.attr("disabled", n), m[n ? "addClass" : "removeClass"](o.classDisabled), e.isFunction(o.disable) && o.disable.apply(u, [l, a, o])
        }, this.repaint = function () {
            x()
        }, this.destroy = function () {
            e([a[0], m[0]]).unbind(".iButton"), e(document).unbind(".iButton_" + f), m.after(a).remove(), e.data(a[0], "iButton", null), e.isFunction(o.destroy) && o.destroy.apply(u, [a, o])
        }, a.wrap('<div class="' + e.trim(o.classContainer + " " + o.className) + '" />').after('<div class="' + o.classHandle + '"><div class="' + o.classHandleRight + '"><div class="' + o.classHandleMiddle + '" /></div></div>' + '<div class="' + o.classLabelOff + '"><span><label>' + o.labelOff + "</label></span></div>" + '<div class="' + o.classLabelOn + '"><span><label>' + o.labelOn + "</label></span></div>" + '<div class="' + o.classPaddingLeft + '"></div><div class="' + o.classPaddingRight + '"></div>');
        var m = a.parent(),
            g = a.siblings("." + o.classHandle),
            y = a.siblings("." + o.classLabelOff),
            b = y.children("span"),
            w = a.siblings("." + o.classLabelOn),
            E = w.children("span");
        if (o.resizeHandle || o.resizeContainer) c.onspan = E.outerWidth(), c.offspan = b.outerWidth();
        o.resizeHandle ? (o.handleWidth ? c.handle = o.handleWidth : c.onspan > 0 ? c.handle = Math.min(c.onspan, c.offspan) : c.handle = c.offspan, g.css("width", c.handle)) : c.handle = g.width(), o.resizeContainer ? (c.container = Math.max(c.onspan, c.offspan) + c.handle + 10, m.css("width", c.container), y.css("width", c.container - 5)) : (c.container = m.width() + 3, console.log(c.container));
        var S = c.container - c.handle - 5,
            x = function (e) {
                var t = a[0].checked,
                    n = t ? S : 0,
                    e = arguments.length > 0 ? arguments[0] : !0;
                e && o.enableFx ? (g.stop().animate({
                    left: n
                }, o.duration, o.easing), w.stop().animate({
                    width: n + 4
                }, o.duration, o.easing), E.stop().animate({
                    marginLeft: n - S
                }, o.duration, o.easing), b.stop().animate({
                    marginRight: -n
                }, o.duration, o.easing)) : (g.css("left", n), w.css("width", n + 4), E.css("marginLeft", n - S), b.css("marginRight", -n))
            };
        x(!1);
        var T = function (e) {
            return e.pageX || (e.originalEvent.changedTouches ? e.originalEvent.changedTouches[0].pageX : 0)
        };
        m.bind("mousedown.iButton touchstart.iButton", function (t) {
            if (e(t.target).is(v) || l || !o.allowRadioUncheck && a.is(":radio:checked")) return;
            return t.preventDefault(), h.clicked = g, p.position = T(t), p.offset = p.position - (parseInt(g.css("left"), 10) || 0), p.time = (new Date).getTime(), !1
        }), o.enableDrag && e(document).bind("mousemove.iButton_" + f + " touchmove.iButton_" + f, function (e) {
            if (h.clicked != g) return;
            e.preventDefault();
            var t = T(e);
            t != p.offset && (h.dragging = !0, m.addClass(o.classHandleActive));
            var n = Math.min(1, Math.max(0, (t - p.offset) / S));
            return g.css("left", n * S), w.css("width", n * S + 4), b.css("marginRight", -n * S), E.css("marginLeft", -(1 - n) * S), !1
        }), e(document).bind("mouseup.iButton_" + f + " touchend.iButton_" + f, function (t) {
            if (h.clicked != g) return !1;
            t.preventDefault();
            var n = !0;
            if (!h.dragging || (new Date).getTime() - p.time < o.clickOffset) {
                var r = a[0].checked;
                a.attr("checked", !r), e.isFunction(o.click) && o.click.apply(u, [!r, a, o])
            } else {
                var i = T(t),
                    s = (i - p.offset) / S,
                    r = s >= .5;
                a[0].checked == r && (n = !1), a.attr("checked", r)
            }
            return m.removeClass(o.classHandleActive), h.clicked = null, h.dragging = null, n ? a.trigger("change") : x(), !1
        }), a.bind("change.iButton", function () {
            x();
            if (a.is(":radio")) {
                var t = a[0],
                    n = e(t.form ? t.form[t.name] : ":radio[name=" + t.name + "]");
                n.filter(":not(:checked)").iButton("repaint")
            }
            e.isFunction(o.change) && o.change.apply(u, [a, o])
        }).bind("focus.iButton", function () {
            m.addClass(o.classFocus)
        }).bind("blur.iButton", function () {
            m.removeClass(o.classFocus)
        }), e.isFunction(o.click) && a.bind("click.iButton", function () {
            o.click.apply(u, [a[0].checked, a, o])
        }), a.is(":disabled") && this.disable(!0), e.browser.msie && (m.find("*").andSelf().attr("unselectable", "on"), a.bind("click.iButton", function () {
            a.triggerHandler("change.iButton")
        })), e.isFunction(o.init) && o.init.apply(u, [a, o])
    }, r = {
            duration: 200,
            easing: "swing",
            labelOn: "ON",
            labelOff: "OFF",
            resizeHandle: "auto",
            resizeContainer: "auto",
            enableDrag: !0,
            enableFx: !0,
            allowRadioUncheck: !1,
            clickOffset: 120,
            handleWidth: 30,
            className: "",
            classContainer: "ibutton-container",
            classDisabled: "ibutton-disabled",
            classFocus: "ibutton-focus",
            classLabelOn: "ibutton-label-on",
            classLabelOff: "ibutton-label-off",
            classHandle: "ibutton-handle",
            classHandleMiddle: "ibutton-handle-middle",
            classHandleRight: "ibutton-handle-right",
            classHandleActive: "ibutton-active-handle",
            classPaddingLeft: "ibutton-padding-left",
            classPaddingRight: "ibutton-padding-right",
            init: null,
            change: null,
            click: null,
            disable: null,
            destroy: null
        }, i = r.labelOn,
        s = r.labelOff
}(jQuery),
function () {
    this.Growl = function () {
        function e() {}
        return e.info = function (e) {
            return e.class_name = "info", e.title = "<i class='icon-info-sign'></i> " + e.title, $.gritter.add(e)
        }, e.warn = function (e) {
            return e.class_name = "warn", e.title = "<i class='icon-warning-sign'></i> " + e.title, $.gritter.add(e)
        }, e.error = function (e) {
            return e.class_name = "error", e.title = "<i class='icon-exclamation-sign'></i> " + e.title, $.gritter.add(e)
        }, e.success = function (e) {
            return e.class_name = "success", e.title = "<i class='icon-ok-sign'></i> " + e.title, $.gritter.add(e)
        }, e
    }(), $(function () {
        return $.extend($.gritter.options, {
            position: "top-right"
        }), $(".growl-info").click(function (e) {
            return e.preventDefault(), Growl.info({
                title: "This is a notice!",
                text: "This will fade out after a certain amount of time."
            })
        }), $(".growl-warn").click(function (e) {
            return e.preventDefault(), Growl.warn({
                title: "This is a warning!",
                text: "This will fade out after a certain amount of time."
            })
        }), $(".growl-error").click(function (e) {
            return e.preventDefault(), Growl.error({
                title: "This is an error!",
                text: "This will fade out after a certain amount of time."
            })
        }), $(".growl-success").click(function (e) {
            return e.preventDefault(), Growl.success({
                title: "This is a success message!",
                text: "This will fade out after a certain amount of time."
            })
        })
    })
}.call(this),
function () {
    $(function () {
        var e, t, n, r;
        return new CalendarEvents($("#external-events")), t = new Date, e = t.getDate(), n = t.getMonth(), r = t.getFullYear(), $("#calendar").fullCalendar({
            header: {
                left: "prev,next",
                center: "title",
                right: "month,agendaWeek,agendaDay"
            },
            editable: !0,
            droppable: !0,
            drop: function (e, t) {
                var n, r;
                r = $(this).data("eventObject"), n = $.extend({}, r), n.start = e, n.allDay = t, $("#calendar").fullCalendar("renderEvent", n, !0);
                if ($("#drop-remove").is(":checked")) return $(this).remove()
            },
            events: [{
                title: "All Day Event",
                start: new Date(r, n, 1)
            }, {
                title: "Long Event",
                start: new Date(r, n, e - 5),
                end: new Date(r, n, e - 2)
            }, {
                id: 999,
                title: "Repeating Event",
                start: new Date(r, n, e - 3, 16, 0),
                allDay: !1
            }, {
                id: 999,
                title: "Repeating Event",
                start: new Date(r, n, e + 4, 16, 0),
                allDay: !1
            }, {
                title: "Meeting",
                start: new Date(r, n, e, 10, 30),
                allDay: !1
            }, {
                title: "Lunch",
                start: new Date(r, n, e, 12, 0),
                end: new Date(r, n, e, 14, 0),
                allDay: !1
            }, {
                title: "Birthday Party",
                start: new Date(r, n, e + 1, 19, 0),
                end: new Date(r, n, e + 1, 22, 30),
                allDay: !1
            }, {
                title: "Click for Google",
                start: new Date(r, n, 28),
                end: new Date(r, n, 29),
                url: "http://google.com/"
            }]
        })
    })
}.call(this), $(function () {
    var e = document.createElement("div"),
        t = -($("html").css("padding-left").replace("px", "") + $("body").css("margin-left").replace("px", "")),
        n = -32;
    e.className = "ex-tooltip", document.body.appendChild(e);
    var r = {
        xScale: "time",
        yScale: "linear",
        main: [{
            className: ".pizza",
            data: [{
                x: "2012-11-05",
                y: 6
            }, {
                x: "2012-11-06",
                y: 6
            }, {
                x: "2012-11-07",
                y: 8
            }, {
                x: "2012-11-08",
                y: 3
            }, {
                x: "2012-11-09",
                y: 4
            }, {
                x: "2012-11-10",
                y: 9
            }, {
                x: "2012-11-11",
                y: 6
            }]
        }]
    }, i = {
            paddingLeft: 15,
            paddingRight: 0,
            axisPaddingTop: 5,
            axisPaddingLeft: 5,
            dataFormatX: function (e) {
                return d3.time.format("%Y-%m-%d").parse(e)
            },
            tickFormatX: function (e) {
                return d3.time.format("%a")(e)
            },
            mouseover: function (r, i) {
                var s = $(this).offset();
                $(e).text(d3.time.format("%A")(r.x) + ": " + r.y).css({
                    top: n + s.top,
                    left: s.left + t
                }).show()
            },
            mouseout: function (t) {
                $(e).hide()
            }
        };
    $("#left-sidebar-chart").length > 0 && new xChart("line-dotted", r, "#left-sidebar-chart", i), $(".xcharts-line-dotted").length > 0 && new xChart("line-dotted", r, ".xcharts-line-dotted", i)
}), $(function () {
    function u(t) {
        s.setData(e[t])
    }

    function a() {
        n += 1, n = n >= t.length ? 0 : n, u(t[n]), i = setTimeout(a, o)
    }
    var e = [{
        xScale: "ordinal",
        comp: [],
        main: [{
            className: ".main.l1",
            data: [{
                y: 15,
                x: "2012-11-19T00:00:00"
            }, {
                y: 11,
                x: "2012-11-20T00:00:00"
            }, {
                y: 8,
                x: "2012-11-21T00:00:00"
            }, {
                y: 10,
                x: "2012-11-22T00:00:00"
            }, {
                y: 1,
                x: "2012-11-23T00:00:00"
            }, {
                y: 6,
                x: "2012-11-24T00:00:00"
            }, {
                y: 8,
                x: "2012-11-25T00:00:00"
            }]
        }, {
            className: ".main.l2",
            data: [{
                y: 29,
                x: "2012-11-19T00:00:00"
            }, {
                y: 33,
                x: "2012-11-20T00:00:00"
            }, {
                y: 13,
                x: "2012-11-21T00:00:00"
            }, {
                y: 16,
                x: "2012-11-22T00:00:00"
            }, {
                y: 7,
                x: "2012-11-23T00:00:00"
            }, {
                y: 18,
                x: "2012-11-24T00:00:00"
            }, {
                y: 8,
                x: "2012-11-25T00:00:00"
            }]
        }],
        type: "line-dotted",
        yScale: "linear"
    }, {
        xScale: "ordinal",
        comp: [],
        main: [{
            className: ".main.l1",
            data: [{
                y: 12,
                x: "2012-11-19T00:00:00"
            }, {
                y: 18,
                x: "2012-11-20T00:00:00"
            }, {
                y: 8,
                x: "2012-11-21T00:00:00"
            }, {
                y: 7,
                x: "2012-11-22T00:00:00"
            }, {
                y: 6,
                x: "2012-11-23T00:00:00"
            }, {
                y: 12,
                x: "2012-11-24T00:00:00"
            }, {
                y: 8,
                x: "2012-11-25T00:00:00"
            }]
        }, {
            className: ".main.l2",
            data: [{
                y: 29,
                x: "2012-11-19T00:00:00"
            }, {
                y: 33,
                x: "2012-11-20T00:00:00"
            }, {
                y: 13,
                x: "2012-11-21T00:00:00"
            }, {
                y: 16,
                x: "2012-11-22T00:00:00"
            }, {
                y: 7,
                x: "2012-11-23T00:00:00"
            }, {
                y: 18,
                x: "2012-11-24T00:00:00"
            }, {
                y: 8,
                x: "2012-11-25T00:00:00"
            }]
        }],
        type: "cumulative",
        yScale: "linear"
    }, {
        xScale: "ordinal",
        comp: [],
        main: [{
            className: ".main.l1",
            data: [{
                y: 12,
                x: "2012-11-19T00:00:00"
            }, {
                y: 18,
                x: "2012-11-20T00:00:00"
            }, {
                y: 8,
                x: "2012-11-21T00:00:00"
            }, {
                y: 7,
                x: "2012-11-22T00:00:00"
            }, {
                y: 6,
                x: "2012-11-23T00:00:00"
            }, {
                y: 12,
                x: "2012-11-24T00:00:00"
            }, {
                y: 8,
                x: "2012-11-25T00:00:00"
            }]
        }, {
            className: ".main.l2",
            data: [{
                y: 29,
                x: "2012-11-19T00:00:00"
            }, {
                y: 33,
                x: "2012-11-20T00:00:00"
            }, {
                y: 13,
                x: "2012-11-21T00:00:00"
            }, {
                y: 16,
                x: "2012-11-22T00:00:00"
            }, {
                y: 7,
                x: "2012-11-23T00:00:00"
            }, {
                y: 18,
                x: "2012-11-24T00:00:00"
            }, {
                y: 8,
                x: "2012-11-25T00:00:00"
            }]
        }],
        type: "bar",
        yScale: "linear"
    }],
        t = [0, 1, 0, 2],
        n = 0,
        r = d3.time.format("%A"),
        i, s, o = 3500;
    $("#xchart-sine").length > 0 && (s = new xChart("bar", e[t[n]], "#xchart-sine", {
        axisPaddingTop: 5,
        paddingLeft: 30,
        dataFormatX: function (e) {
            return new Date(e)
        },
        tickFormatX: function (e) {
            return d3.time.format("%a")(e)
        }
    }), i = setTimeout(a, o))
}), $(function () {
    var e = function () {
        var e = {
            xScale: "ordinal",
            yScale: "linear"
        };
        e.main = [];
        var t = $(["Beef", "Ham", "Bacon"]);
        return $([1, 2, 3]).each(function () {
            var n = [];
            t.each(function () {
                n.push({
                    x: this,
                    y: getRandomInt(3, 12)
                })
            }), e.main.push({
                className: ".food",
                data: n
            })
        }), e
    };
    if ($(".xcharts-bar").length > 0) {
        var t = new xChart("bar", e(), ".xcharts-bar", {
            axisPaddingTop: 5,
            paddingLeft: 15
        });
        $("#randomize-bar-chart").click(function () {
            t.setData(e())
        })
    }
}),
function () {
    $(function () {
        var e, t, n, r, i, s, o, u;
        t = $.map(Theme.colors, function (e) {
            return e
        }), u = {
            names: {
                0: "Automotive",
                1: "Locomotive",
                2: "Unmotivated",
                3: "Three",
                4: "Four",
                5: "Five"
            }
        }, s = function () {
            var e;
            return e = $(".spark-pie").width(), e > 200 && (e = 200), $(".spark-pie").sparkline([55, 100, 220, 180], {
                type: "pie",
                height: e,
                sliceColors: t,
                tooltipFormat: '<span style="color: {{color}}">&#9679;</span> {{offset:names}} ({{percent.1}}%)',
                tooltipValueLookups: u
            })
        }, r = function (e, t) {
            var n, r, i, s, o;
            return s = t.width(), n = e.length, r = 5, o = s - (n - 1) * r, i = o / n, t.sparkline(e, {
                type: "bar",
                barColor: Theme.colors.blue,
                height: 200,
                barWidth: i,
                barSpacing: r,
                tooltipSuffix: "$ income received"
            })
        }, e = [4, 1, 5, 7, 9, 9, 8, 7, 6, 6, 4, 7, 8, 4, 3, 2, 2, 5, 6, 7], o = [6, 3, 8, 5, 8, 4, 3, 2, 7, 6, 6, 4, 7, 2, 5, 6, 7, 2, 4, 11], i = function () {
            return $(".spark-composite").sparkline(o, {
                composite: !0,
                fillColor: !1,
                lineColor: Theme.colors.red,
                width: "100%",
                height: "200",
                spotColor: Theme.colors.lightBlue,
                lineWidth: 3,
                maxSpotColor: Theme.colors.red,
                highlightSpotColor: Theme.colors.orange,
                highlightLineColor: Theme.colors.orange,
                chartRangeMin: 0,
                spotRadius: 4,
                drawNormalOnTop: !1,
                tooltipSuffix: " orders sent"
            })
        }, r(e, $(".spark-composite")), i(), s(), $(window).resize(function () {
            return r(e, $(".spark-composite")), i(), s()
        }), n = function () {
            var e, t, n, r, i, s, o, u;
            return u = 100, t = -1, n = -1, e = void 0, i = 0, s = [], o = 30, $("html").mousemove(function (e) {
                var r, s;
                return r = e.pageX, s = e.pageY, t > -1 && (i += Math.max(Math.abs(r - t), Math.abs(s - n))), t = r, n = s
            }), r = function () {
                var t, n, a;
                return t = new Date, a = t.getTime(), e && e !== a && (n = Math.round(i / (a - e) * 1e3), s.push(n), s.length > o && s.splice(0, 1), i = 0, $(".spark-mouse").sparkline(s, {
                    type: "line",
                    width: "100%",
                    height: "200",
                    chartRangeMin: 0,
                    chartRangeMax: 3e3,
                    lineColor: Theme.colors.blue,
                    fillColor: Theme.colors.lightBlue,
                    spotColor: Theme.colors.lightBlue,
                    lineWidth: 3,
                    maxSpotColor: Theme.colors.red,
                    highlightSpotColor: Theme.colors.orange,
                    highlightLineColor: Theme.colors.orange,
                    spotRadius: 4,
                    drawNormalOnTop: !1,
                    tooltipSuffix: " pixels per second"
                })), e = a, setTimeout(r, u)
            }, setTimeout(r, u)
        };
        if ($(".spark-mouse").length > 0) return n()
    })
}.call(this),
function () {
    this.Theme = function () {
        function e() {}
        return e.colors = {
            darkGreen: "#779148",
            red: "#C75D5D",
            green: "#96c877",
            blue: "#6e97aa",
            orange: "#ff9f01",
            gray: "#6B787F",
            lightBlue: "#D4E5DE"
        }, e
    }(), $(function () {
        var e;
        return $(".icheck").iCheck({
            checkboxClass: "icheckbox_flat-aero",
            radioClass: "iradio_flat-aero"
        }), $.uniform.options.fileBtnText = "+", $(".sparkline").each(function () {
            var e, t, n, r;
            return n = $(this).attr("data-color") || "red", r = "18px", $(this).hasClass("big") && (t = "5px", e = "2px", r = "30px"), $(this).sparkline("html", {
                type: "bar",
                barColor: Theme.colors[n],
                height: r,
                barWidth: t,
                barSpacing: e,
                zeroAxis: !1
            })
        }), $(".tip, [rel=tooltip]").tooltip({
            gravity: "n",
            fade: !0,
            html: !0
        }), $("[data-percent]").each(function () {
            return $(this).css({
                width: "" + $(this).attr("data-percent") + "%"
            })
        }), $(".datepicker").datepicker({
            todayBtn: !0
        }), $(".tags").tagsInput({
            width: "100%"
        }), $("form.validatable").validationEngine({
            promptPosition: "topLeft"
        }), $(".chzn-select").select2(), $(".textarea-html5").wysihtml5({
            "font-styles": !0,
            emphasis: !0,
            lists: !0,
            html: !1,
            link: !0,
            image: !0,
            color: !1,
            stylesheets: !1
        }), $.extend($.fn.dataTableExt.oStdClasses, {
            sWrapper: "dataTables_wrapper form-inline"
        }), $(".dTable").dataTable({
            bJQueryUI: !1,
            bAutoWidth: !1,
            sPaginationType: "full_numbers",
            sDom: '<"table-header"fl>t<"table-footer"ip>'
        }), $(".dTable-small").dataTable({
            iDisplayLength: 5,
            bJQueryUI: !1,
            bAutoWidth: !1,
            sPaginationType: "full_numbers",
            sDom: '<"table-header"fl>t<"table-footer"ip>'
        }), $("select.uniform, input:file, .dataTables_length select").uniform(), $(".core-animate-bars .box-toolbar a").click(function (e) {
            return e.preventDefault(), $(this).closest(".core-animate-bars").find(".progress .tip").each(function () {
                var e, t;
                return t = Math.floor(Math.random() * 80) + 20, e = "" + t + "%", $(this).attr("title", e).attr("data-percent", t).attr("data-original-title", e).css({
                    width: e
                })
            })
        }), $(".normal-slider").slider(), $(".ranged-slider-ui.normal").slider({
            range: !0,
            min: 0,
            max: 300,
            values: [40, 250]
        }), $(".ranged-slider-ui.only-min").slider({
            range: "min",
            min: 0,
            max: 300,
            value: 40
        }), $(".ranged-slider-ui.only-max").slider({
            range: "max",
            min: 0,
            max: 300,
            value: 240
        }), $(".ranged-slider-ui.step").slider({
            range: "min",
            min: 20,
            max: 120,
            value: 40,
            step: 20,
            slide: function (e, t) {
                return $(".upload-max-size").html("" + t.value + " MB")
            }
        }), $(".ranged-slider-ui.vertical-bars span").each(function () {
            var e;
            return e = parseInt($(this).text(), 10), $(this).empty().slider({
                value: e,
                range: "min",
                animate: !0,
                orientation: "vertical"
            })
        }), $(".iButton-icons").iButton({
            labelOn: "<i class='icon-ok'></i>",
            labelOff: "<i class='icon-remove'></i>",
            handleWidth: 30
        }), $(".iButton-enabled").iButton({
            labelOn: "ENABLED",
            labelOff: "DISABLED",
            handleWidth: 30
        }), $(".iButton").iButton(), $(".iButton-icons-tab").each(function () {
            if ($(this).is(":visible")) return $(this).iButton({
                labelOn: "<i class='icon-ok'></i>",
                labelOff: "<i class='icon-remove'></i>",
                handleWidth: 30
            })
        }), $('[data-toggle="tab"]').on("shown", function (e) {
            var t;
            return t = $(e.target).attr("href"), $(t).find(".iButton-icons-tab").iButton({
                labelOn: "<i class='icon-ok'></i>",
                labelOff: "<i class='icon-remove'></i>",
                handleWidth: 30
            })
        }), $("#thumbs a").touchTouch(), $("a[href='#'][data-toggle!='dropdown']").click(function (e) {
            return e.preventDefault()
        }), $(".closable-chat-box textarea").click(function () {
            return $(this).closest(".closable-chat-box").addClass("open"), $(this).wysihtml5({
                "font-styles": !0,
                emphasis: !0,
                lists: !0,
                html: !1,
                link: !0,
                image: !0,
                color: !1,
                stylesheets: !1
            })
        }), e = [], $(".justgage").each(function () {
            var t, n, r;
            return r = $(this).attr("data-labels") || !0, t = $(this).attr("data-gauge-width-scale") || 1, n = $(this).attr("data-animation-type") || "linear", e.push(new JustGage({
                id: $(this).attr("id"),
                min: 0,
                max: 100,
                title: $(this).attr("data-title"),
                value: getRandomInt(1, 80),
                label: "",
                levelColorsGradient: !1,
                showMinMax: r,
                gaugeWidthScale: t,
                startAnimationTime: 1e3,
                startAnimationType: ">",
                refreshAnimationTime: 1e3,
                refreshAnimationType: n,
                levelColors: [Theme.colors.green, Theme.colors.orange, Theme.colors.red]
            }))
        }), setInterval(function () {
            return $(e).each(function () {
                return this.refresh(getRandomInt(0, 80))
            })
        }, 2500), $(".easy-pie-chart").each(function () {
            var e;
            return e = $(this), $(this).easyPieChart({
                lineWidth: 10,
                size: 150,
                lineCap: "square",
                barColor: Theme.colors[e.data("color")] || Theme.colors.red,
                scaleColor: Theme.colors.gray,
                animate: 1e3
            })
        }), $(".easy-pie-chart-small").each(function () {
            var e;
            return e = $(this), $(this).easyPieChart({
                lineWidth: 4,
                size: 40,
                lineCap: "square",
                barColor: Theme.colors[e.attr("data-color")] || Theme.colors.red,
                animate: 1e3
            })
        }), $(".easy-pie-chart-percent").easyPieChart({
            animate: 1e3,
            trackColor: "#444",
            scaleColor: "#444",
            lineCap: "square",
            lineWidth: 15,
            size: 150,
            barColor: function (e) {
                return "rgb(" + Math.round(200 * e / 100) + ", " + Math.round(200 * (1 - e / 100)) + ", 0)"
            }
        }), setInterval(function () {
            return $(".easy-pie-chart, .easy-pie-chart-percent").each(function () {
                var e;
                return e = getRandomInt(0, 80), $(this).data("easyPieChart").update(e), $(this).find("span").text("" + e + "%")
            })
        }, 2500)
    })
}.call(this),
function () {
    $(function () {
        return $(".toggle-sidebar").click(function (e) {
            return e.preventDefault(), $(".secondary-sidebar").toggleClass("open"), $(this).toggleClass("active"), $.sparkline_display_visible()
        }), $(".toggle-primary-sidebar").click(function (e) {
            return e.preventDefault(), $(".primary-sidebar").toggleClass("open"), $(this).toggleClass("active"), $.sparkline_display_visible()
        })
    })
}.call(this);